durusmail: qp: problem in publisher init
problem in publisher init
2005-11-26
2005-11-28
2005-11-28
2005-11-28
problem in publisher init
mario ruggier
2005-11-26
Hi,

the qp Publisher's init does:

     def __init__(self, connection=None, site=None):
         set_publisher(self)
         self.connection = connection or Connection(TempFileStorage())
         self.set_hit(None)
         self.ensure_initialized()
         self.site = site or qp.lib.site.Site.get_sites().values()[0]
         self.root_directory = self.site.get_root_directory_class()()

however, if i override Publisher.ensure_initialized(), and in there I
make use of something such as:

         self.site.get_name()

Then I get:

     AttributeError: 'SitePublisher' object has no attribute 'site'


Shouldn't setting self.site be moved as far up as possible, i.e. just
after setting of self.connection in the __init__() ?

mario

reply