server/sources/__init__.py
changeset 6724 24bf6f181d0e
parent 6722 3341521d857b
child 6931 0af44a38fe41
equal deleted inserted replaced
6723:a2ccbcbb08a6 6724:24bf6f181d0e
   114 
   114 
   115     def init_creating(self):
   115     def init_creating(self):
   116         """method called by the repository once ready to create a new instance"""
   116         """method called by the repository once ready to create a new instance"""
   117         pass
   117         pass
   118 
   118 
   119     def init(self):
   119     def init(self, activated, session=None):
   120         """method called by the repository once ready to handle request"""
   120         """method called by the repository once ready to handle request.
       
   121         `activated` is a boolean flag telling if the source is activated or not.
       
   122         """
   121         pass
   123         pass
   122 
   124 
   123     def backup(self, backupfile, confirm):
   125     def backup(self, backupfile, confirm):
   124         """method called to create a backup of source's data"""
   126         """method called to create a backup of source's data"""
   125         pass
   127         pass
   144     def clear_eid_cache(self, eid, etype):
   146     def clear_eid_cache(self, eid, etype):
   145         """clear potential caches for the given eid"""
   147         """clear potential caches for the given eid"""
   146         pass
   148         pass
   147 
   149 
   148     def __repr__(self):
   150     def __repr__(self):
   149         return '<%s source @%#x>' % (self.uri, id(self))
   151         return '<%s source %s @%#x>' % (self.uri, self.eid, id(self))
   150 
   152 
   151     def __cmp__(self, other):
   153     def __cmp__(self, other):
   152         """simple comparison function to get predictable source order, with the
   154         """simple comparison function to get predictable source order, with the
   153         system source at last
   155         system source at last
   154         """
   156         """