entities/sources.py
changeset 6945 28bf94d062a9
parent 6944 0cf10429ad39
child 6957 ffda12be2e9f
equal deleted inserted replaced
6944:0cf10429ad39 6945:28bf94d062a9
    95                 self._cw.create_entity('CWSourceSchemaConfig',
    95                 self._cw.create_entity('CWSourceSchemaConfig',
    96                                        cw_for_source=self,
    96                                        cw_for_source=self,
    97                                        cw_schema=schemaentity,
    97                                        cw_schema=schemaentity,
    98                                        options=options)
    98                                        options=options)
    99 
    99 
       
   100     @property
       
   101     def repo_source(self):
       
   102         """repository only property, not available from the web side (eg
       
   103         self._cw is expected to be a server session)
       
   104         """
       
   105         return self._cw.repo.sources_by_eid[self.eid]
       
   106 
   100 
   107 
   101 class CWSourceHostConfig(_CWSourceCfgMixIn, AnyEntity):
   108 class CWSourceHostConfig(_CWSourceCfgMixIn, AnyEntity):
   102     __regid__ = 'CWSourceHostConfig'
   109     __regid__ = 'CWSourceHostConfig'
   103     fetch_attrs, fetch_order = fetch_config(['match_host', 'config'])
   110     fetch_attrs, fetch_order = fetch_config(['match_host', 'config'])
       
   111 
       
   112     @property
       
   113     def cwsource(self):
       
   114         return self.cw_host_config_of[0]
   104 
   115 
   105     def match(self, hostname):
   116     def match(self, hostname):
   106         return re.match(self.match_host, hostname)
   117         return re.match(self.match_host, hostname)
   107 
   118 
   108 
   119