Crashes on fedora 15 (python 2.7.1)

90 views
Skip to first unread message

Anna Wiggins

unread,
Nov 2, 2011, 1:32:45 PM11/2/11
to gaphor-dev
Hi,

After installing gaphor on fedora 2.7.1, attempting to launch it
resulted in:

$ gaphor
Application INFO initializing service service.component_registry
Traceback (most recent call last):
File "/usr/bin/gaphor", line 9, in <module>
load_entry_point('gaphor==0.17.1', 'console_scripts', 'gaphor')()
File "/usr/lib/python2.7/site-packages/gaphor-0.17.1-py2.7.egg/
gaphor/__init__.py", line 97, in main
launch(model)
File "/usr/lib/python2.7/site-packages/gaphor-0.17.1-py2.7.egg/
gaphor/__init__.py", line 33, in launch
Application.init()
File "/usr/lib/python2.7/site-packages/gaphor-0.17.1-py2.7.egg/
gaphor/application.py", line 52, in init
self.init_all_services()
File "/usr/lib/python2.7/site-packages/gaphor-0.17.1-py2.7.egg/
gaphor/application.py", line 83, in init_all_services
self.init_service(name)
File "/usr/lib/python2.7/site-packages/gaphor-0.17.1-py2.7.egg/
gaphor/application.py", line 99, in init_service
srv.init(self)
File "/usr/lib/python2.7/site-packages/gaphor-0.17.1-py2.7.egg/
gaphor/services/componentregistry.py", line 30, in init
self._components = component.registry.Components(
AttributeError: 'module' object has no attribute 'registry'



Poking around in the source code, it looks like at some point Zope
stopped liking a direct call to component.registry. Not sure why that
would happen, exactly. At any rate, this patch fixes the problem for
me:


diff --git a/gaphor/services/componentregistry.py b/gaphor/services/
componentregistry.py
index 333c8e8..51628b4 100644
--- a/gaphor/services/componentregistry.py
+++ b/gaphor/services/componentregistry.py
@@ -6,6 +6,7 @@ Maybe we should split the ComponentRegistry in a
Dispatcher (register_handler,
unregister_handler, handle), a AdapterRegistry and a Subscription
registry.
"""

+from zope.component import registry
from zope import interface, component
from gaphor.core import inject
from gaphor.interfaces import IService, IEventFilter
@@ -27,7 +28,7 @@ class ZopeComponentRegistry(object):
pass

def init(self, app):
- self._components = component.registry.Components(
+ self._components = registry.Components(
name='component_registry',

bases=(component.getGlobalSiteManager(),))
Reply all
Reply to author
Forward
0 new messages