cubicweb/server/sources/__init__.py
branch3.25
changeset 12148 79160d54662e
parent 12144 f54286c1cef5
child 12149 649100470733
equal deleted inserted replaced
12147:232eefd6d3b3 12148:79160d54662e
   184 
   184 
   185     def init_creating(self):
   185     def init_creating(self):
   186         """method called by the repository once ready to create a new instance"""
   186         """method called by the repository once ready to create a new instance"""
   187         pass
   187         pass
   188 
   188 
   189     def init(self, activated, source_entity):
   189     def init(self, source_entity):
   190         """method called by the repository once ready to handle request.
   190         """method called by the repository once ready to handle request.
   191         `activated` is a boolean flag telling if the source is activated or not.
   191         `activated` is a boolean flag telling if the source is activated or not.
   192         """
   192         """
   193         if not activated:
       
   194             return
       
   195         source_entity.complete()
   193         source_entity.complete()
   196         if source_entity.url:
   194         if source_entity.url:
   197             self.urls = [url.strip() for url in source_entity.url.splitlines()
   195             self.urls = [url.strip() for url in source_entity.url.splitlines()
   198                          if url.strip()]
   196                          if url.strip()]
   199         else:
   197         else: