rpymostat.engine.site_hierarchy module¶
-
class
rpymostat.engine.site_hierarchy.SiteHierarchy(apiserver, app, dbconn, parent_prefix)[source]¶ Bases:
objectHelper class to implement hierarchical sites in Klein. All engine classes that provide routes must implement this.
-
_abc_cache= <_weakrefset.WeakSet object>¶
-
_abc_negative_cache= <_weakrefset.WeakSet object>¶
-
_abc_negative_cache_version= 29¶
-
_abc_registry= <_weakrefset.WeakSet object>¶
-
_parse_json_request(request)[source]¶ Parse a JSON request; return the deserialized request or raise an exception.
Parameters: request (instance of twisted.web.server.Request) – the requestReturns: deserialized request JSON Return type: str
-
add_route(func, path=None, methods=['GET'])[source]¶ Add a route to app, mapping
func(a callable method in this class) topath(underself.prefix). Ifpathis none, it will be mapped directly toself.prefix.Parameters:
-
make_prefix(parent_list, prefix_str)[source]¶ Given a list of the parent’s prefix and our prefix string, construct a new list with our prefix.
Parameters: Returns: our prefix list
Return type:
-
prefix_list_to_str(prefix_list)[source]¶ Convert a prefix list to a string path prefix.
Parameters: prefix_list (list) – the list to convert Returns: prefix string Return type: str
-
prefix_part= 'base'¶
-