From c1bb0713a637b02555295a9b2546554be88f9402 Mon Sep 17 00:00:00 2001 From: Arjan Molenaar Date: Wed, 1 Aug 2007 13:59:01 +0000 Subject: [PATCH] * fixed line endings * fix stock icon loading so it works in conjunction with plugins. git-svn-id: file:///Users/arjan/backup/gaphor/gaphor/trunk@1806 a8418922-720d-0410-834f-a69b97ada669 --- gaphor/core.py | 78 +++++++++++++++++++++++----------------------- gaphor/ui/stock.py | 4 +-- setup.py | 7 +++-- 3 files changed, 46 insertions(+), 43 deletions(-) diff --git a/gaphor/core.py b/gaphor/core.py index 4d907d6bc..d0a68b463 100644 --- a/gaphor/core.py +++ b/gaphor/core.py @@ -1,39 +1,39 @@ -""" -The Core module provides an entry point for Gaphor's core constructs. - -An average module should only need to import this module. -""" - -from gaphor.application import Application as _Application -from gaphor.transaction import Transaction, transactional -from gaphor.action import action, toggle_action, radio_action, build_action_group -from gaphor.i18n import _ - - -class inject(object): - """ - Simple descriptor for dependency injection. - This is technically a wrapper around Application.get_service(). - - Usage:: - - class A(object): - gui_manager = inject('gui_manager') - """ - - def __init__(self, name): - self._name = name - self._inj = None - - def __get__(self, obj, class_=None): - """ - Resolve a dependency, but only if we're called from an object instance. - """ - if not obj: - return self - if self._inj is None: - self._inj = _Application.get_service(self._name) - return self._inj - - -# vim:sw=4:et:ai +""" +The Core module provides an entry point for Gaphor's core constructs. + +An average module should only need to import this module. +""" + +from gaphor.application import Application as _Application +from gaphor.transaction import Transaction, transactional +from gaphor.action import action, toggle_action, radio_action, build_action_group +from gaphor.i18n import _ + + +class inject(object): + """ + Simple descriptor for dependency injection. + This is technically a wrapper around Application.get_service(). + + Usage:: + + class A(object): + gui_manager = inject('gui_manager') + """ + + def __init__(self, name): + self._name = name + self._inj = None + + def __get__(self, obj, class_=None): + """ + Resolve a dependency, but only if we're called from an object instance. + """ + if not obj: + return self + if self._inj is None: + self._inj = _Application.get_service(self._name) + return self._inj + + +# vim:sw=4:et:ai diff --git a/gaphor/ui/stock.py b/gaphor/ui/stock.py index bcf99756a..b6b15e056 100644 --- a/gaphor/ui/stock.py +++ b/gaphor/ui/stock.py @@ -116,7 +116,7 @@ def load_stock_icons(): """ from xml.sax import make_parser parser = make_parser() - icon_dir = os.path.abspath(pkg_resources.resource_filename('gaphor', 'ui/pixmaps')) + icon_dir = os.path.abspath(pkg_resources.resource_filename('gaphor.ui', 'pixmaps')) log.info('Icon dir: %s' % icon_dir) #icon_dir = 'gaphor/data/pixmaps' loader = StockIconLoader(icon_dir) @@ -124,7 +124,7 @@ def load_stock_icons(): parser.setFeature(handler.feature_namespaces, 1) parser.setContentHandler(loader) - filename = pkg_resources.resource_filename('gaphor', 'ui/icons.xml') + filename = pkg_resources.resource_filename('gaphor.ui', 'icons.xml') if os.name == 'nt': # Make the filename a full URL filename = 'file:' + filename.replace('\\\\', '/') diff --git a/setup.py b/setup.py index 5805d8eb7..3293aa195 100644 --- a/setup.py +++ b/setup.py @@ -89,8 +89,11 @@ setup( author_email='arjanmol@users.sourceforge.net', license='GNU General Public License', description='Gaphor is a UML modeling tool', - long_description="Gaphor is a UML modeling tool written in Python. " - "It uses the GTK+ environment for user interaction.", + long_description=""" +Gaphor is a UML modeling tool written in Python. + +It uses the GTK+ environment for user interaction. +""", classifiers = [ 'Development Status :: 4 - Beta', 'Environment :: X11 Applications :: GTK',