server/sources/__init__.py
changeset 2476 1294a6bdf3bf
parent 1977 606923dff11b
child 2493 9806571ea790
equal deleted inserted replaced
2475:b6753521129d 2476:1294a6bdf3bf
    51     # a global identifier for this source, which has to be set by the source
    51     # a global identifier for this source, which has to be set by the source
    52     # instance
    52     # instance
    53     uri = None
    53     uri = None
    54     # a reference to the system information helper
    54     # a reference to the system information helper
    55     repo = None
    55     repo = None
    56     # a reference to the application'schema (may differs from the source'schema)
    56     # a reference to the instance'schema (may differs from the source'schema)
    57     schema = None
    57     schema = None
    58 
    58 
    59     def __init__(self, repo, appschema, source_config, *args, **kwargs):
    59     def __init__(self, repo, appschema, source_config, *args, **kwargs):
    60         self.repo = repo
    60         self.repo = repo
    61         self.uri = source_config['uri']
    61         self.uri = source_config['uri']
    93         if other.uri == 'system':
    93         if other.uri == 'system':
    94             return -1
    94             return -1
    95         return cmp(self.uri, other.uri)
    95         return cmp(self.uri, other.uri)
    96 
    96 
    97     def set_schema(self, schema):
    97     def set_schema(self, schema):
    98         """set the application'schema"""
    98         """set the instance'schema"""
    99         self.schema = schema
    99         self.schema = schema
   100 
   100 
   101     def support_entity(self, etype, write=False):
   101     def support_entity(self, etype, write=False):
   102         """return true if the given entity's type is handled by this adapter
   102         """return true if the given entity's type is handled by this adapter
   103         if write is true, return true only if it's a RW support
   103         if write is true, return true only if it's a RW support