If TracUnreadPlugin is activated when trac environment is initialized using '--inherit' option, trac enviroment will be failed with following error message.
Creating and Initializing Project
Done
Initenv for 'd:\pubs\trac\site\test2' failed.
Failed to create environment.
'TracUnreadSetupParticipant' object has no attribute 'environment_needs_upgarde'
Traceback (most recent call last):
File "c:\python25\lib\site-packages\Trac-0.11.1-py2.5.egg\trac\admin\console.p
y", line 568, in do_initenv
options=options)
File "c:\python25\lib\site-packages\Trac-0.11.1-py2.5.egg\trac\env.py", line 1
94, in __init__
setup_participant.environment_created()
File "build\bdist.win32\egg\trac_unread\env_setup.py", line 39, in environment
_created
if self.environment_needs_upgarde(db):
AttributeError: 'TracUnreadSetupParticipant' object has no attribute 'environmen
t_needs_upgarde'
I changed 'env_setup.py' as shown below, and it seems to work fine now.
Index: 0.11/trac_unread/env_setup.py
===================================================================
--- 0.11/trac_unread/env_setup.py (revision 4358)
+++ 0.11/trac_unread/env_setup.py (working copy)
@@ -35,8 +35,9 @@
def environment_created(self):
"""Called when a new Trac environment is created."""
- if self.environment_needs_upgrade(None):
- self.upgrade_environment(None)
+ db = self.env.get_db_cnx()
+ if self.environment_needs_upgrade(db):
+ self.upgrade_environment(db)
def environment_needs_upgrade(self, db):
"""Called when Trac checks whether the environment needs to be upgraded.