Source code for rbtlib.root

#-------------------------------------------------------------------------------
# rbtlib: root.py
#
# Get the Root List Resource from a Review Board instance.
#-------------------------------------------------------------------------------
# The MIT License (MIT)
# Copyright (c) 2016 Brian Minard
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#-------------------------------------------------------------------------------
import collections
from resource import ResourceFactory


[docs]class Root(ResourceFactory): """The Root List Resource for the Review Board instance. A helper class, requiring the fully-qualified domain name and URI scheme used by the Review Board instance to query. The caller needn't specify the entire URL to the Root List Resource. Other Web API resources should rely upon the parent class. Attributes: session: the HTTP session. url: the URL defining the resource location. name: the resource name. """ name = 'root' def __init__(self, session, url): """Construct a Root List Resource.""" super(Root, self).__init__(session, self.name, url + '/api/', 'GET')