Package occi :: Package protocol :: Module occi_parser
[hide private]
[frames] | no frames]

Module occi_parser

source code

Set of functions to parse stuff.

Created on Jun 28, 2011


Author: tmetsch

Functions [hide private]
 
get_category(category_string, registry, extras, is_mixin=False)
Create a Category from a string rendering.
source code
 
get_category_str(category, registry)
Create a string rendering for a Category.
source code
 
_get_link_categories(categories, registry, extras)
Determine the kind ans mixins for inline link creation.
source code
 
get_link(link_string, source, registry, extras)
Create a Link from a string rendering.
source code
 
get_link_str(link)
Create a string rendering for a Link.
source code
 
get_attributes(attribute_string)
Retrieve the attributes from the HTTP X-OCCI-Attribute rendering.
source code
 
_strip_all(string)
Removes beginning / ending quotes and whitespaces.
source code
 
find_in_string(string, name)
Search for string which is surrounded by '<name>=' and ';'.
source code
Variables [hide private]
  __package__ = 'occi.protocol'

Imports: Category, Link, Mixin, Kind


Function Details [hide private]

get_category(category_string, registry, extras, is_mixin=False)

source code 

Create a Category from a string rendering.

If found it will return the object from the registry.

If is_mixin is set to true it will not match with the registry and just return a Mixin.

category_string -- A string rendering of a category. registry -- To generate a list of registered categories. extras -- The passed on extras argument is_mixin -- Mixin will be created and no matching will be done.

get_category_str(category, registry)

source code 

Create a string rendering for a Category.

category -- A category. registry -- registry to retrieve hostname.

_get_link_categories(categories, registry, extras)

source code 

Determine the kind ans mixins for inline link creation.

categories -- String with a set of category string definitions. registry -- Registry used for this call. extras -- Passed on extra object.

get_link(link_string, source, registry, extras)

source code 

Create a Link from a string rendering.

Also note that the link_id is set but is not yet registered as resource.

link_string -- A string rendering of a link. source -- The source entity. registry -- Registry used for this call. extras -- Passed on extra object.

get_link_str(link)

source code 

Create a string rendering for a Link.

link -- A link.

find_in_string(string, name)

source code 

Search for string which is surrounded by '<name>=' and ';'. Raises AttributeError if value cannot be found.

string -- The string to look into. name -- The name of the value to look for.