* 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
This commit is contained in:
Arjan Molenaar 2007-08-01 13:59:01 +00:00
parent 58e9b4e87e
commit c1bb0713a6
3 changed files with 46 additions and 43 deletions

View File

@ -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

View File

@ -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('\\\\', '/')

View File

@ -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',