Skip to content
Browse files

*** empty log message ***

git-svn-id: file:///Users/arjan/backup/gaphor/trunk/gaphor@193 a8418922-720d-0410-834f-a69b97ada669
  • Loading branch information...
1 parent f062713 commit 6d06a378212ab30de0302a3f73c99b6c71bf61ef @amolenaar committed Apr 1, 2003
Showing with 72 additions and 43 deletions.
  1. +4 −0 ChangeLog
  2. +2 −13 TODO
  3. +13 −11 data/gaphor-diagram-ui.xml
  4. +1 −1 gaphor/ui/commandregistry.py
  5. +1 −1 gaphor/ui/diagramwindow.py
  6. +51 −17 setup.py
View
4 ChangeLog
@@ -1,3 +1,7 @@
+2002-03-31 Arjan Molenaar <arjanmolenaar@hetnet.nl>
+
+ * setup.py: check versions of modules.
+
2002-03-22 Arjan Molenaar <arjanmolenaar@hetnet.nl>
* gaphor/diagram/association.py: fixed bug that didn't show
View
15 TODO
@@ -7,17 +7,6 @@ As always, there is much to do...
- Add some sort of ordering in the NamespaceView.
- Items visible/hidden doesn't work properly when opening a diagram.
----
-It seems like PyObject's do not live as long as GObject objects. Once a PyObject
-object has no references to itself, it can be destroyed (or at least it's
-dictionary can). This should have been prevented in the pygobject_dealloc()
-function in the PyGTK package. For most items there is no problem, since they
-are referenced by a UML modelelement. Some, such as CommentLineItem, end up
-with an empty dictionary after loading.
-
-Currently gaphor/storage.py contains a lot of debug stuff, COmmentLineItem uses
-get/set_data to store its id.
----
- Diagram items should be created for lots of model elements
(we currently have Actor, UseCase, Comment and the fancy line that connects
a comment with another model element). Also a buch of relationships are
@@ -41,8 +30,8 @@ More specific:
moved from the DiagramItems to the data elements.
- A more pattern driven design (using Factories, Singletons etc.). We're doing
a pretty good job already, though...
-- Add features to classes (attribute and operation).
-
+- Let commands determine if they are visible/sensible, instead of a
+ has_capability function on the diagram item.
- Create a Classifier item, which should function as superclass for Class,
Interface, Stereotype, Datatype, etc.
View
24 data/gaphor-diagram-ui.xml
@@ -60,8 +60,6 @@
<popups>
<!-- Generic popup menu: -->
<popup name="DiagramView">
- <menuitem name="EditDelete" verb=""/>
- <separator/>
<!-- For classes: -->
<menuitem name="CreateAttribute" verb=""/>
<menuitem name="CreateOperation" verb=""/>
@@ -72,32 +70,36 @@
<menuitem name="DeleteSegment" verb=""/>
<menuitem name="Orthogonal" verb="" type="toggle"/>
<separator/>
+ <menuitem name="EditDelete" verb=""/>
+ <menuitem name="DeleteAttribute" verb=""/>
+ <menuitem name="DeleteOperation" verb=""/>
+ <separator/>
<menuitem name="SnapToGrid" verb="" type="toggle"/>
</popup>
<!-- Specific popup menus: they have the name of the
item they are meny to be used for. -->
<popup name="Association">
- <menuitem name="EditDelete" verb=""/>
- <separator/>
<menuitem name="AddSegment" verb=""/>
<menuitem name="DeleteSegment" verb=""/>
<menuitem name="Orthogonal" verb="" type="toggle"/>
<separator/>
<submenu _label="Side A">
- <menuitem name="Tail_isNavigable" verb="" type="toggle"/>
- <separator/>
- <menuitem name="Tail_None" verb="" type="radio" group="ak_tail"/>
- <menuitem name="Tail_Aggregate" verb="" type="radio" group="ak_tail"/>
- <menuitem name="Tail_Composite" verb="" type="radio" group="ak_tail"/>
- </submenu>
- <submenu _label="Side B">
<menuitem name="Head_isNavigable" verb="" type="toggle"/>
<separator/>
<menuitem name="Head_None" verb="" type="radio" group="ak_head"/>
<menuitem name="Head_Aggregate" verb="" type="radio" group="ak_head"/>
<menuitem name="Head_Composite" verb="" type="radio" group="ak_head"/>
</submenu>
+ <submenu _label="Side B">
+ <menuitem name="Tail_isNavigable" verb="" type="toggle"/>
+ <separator/>
+ <menuitem name="Tail_None" verb="" type="radio" group="ak_tail"/>
+ <menuitem name="Tail_Aggregate" verb="" type="radio" group="ak_tail"/>
+ <menuitem name="Tail_Composite" verb="" type="radio" group="ak_tail"/>
+ </submenu>
+ <separator/>
+ <menuitem name="EditDelete" verb=""/>
<separator/>
<menuitem name="SnapToGrid" verb="" type="toggle"/>
</popup>
View
2 gaphor/ui/commandregistry.py
@@ -16,7 +16,7 @@ def __init__(self, command):
self.executing = 0
def __call__(self, ui_component, name, type=-1, state=0):
- print 'CommandExecuter.__call__:', ui_component, name, type, state
+ #print 'CommandExecuter.__call__:', ui_component, name, type, state
if not self.executing:
self.executing = 1
try:
View
2 gaphor/ui/diagramwindow.py
@@ -72,7 +72,7 @@ def construct(self):
self._construct_window(name='diagram',
title=title,
- size=(400, 400),
+ size=(550, 550),
contents=table,
params={ 'window': self })
View
68 setup.py
@@ -36,22 +36,24 @@ class config_Gaphor(Command):
description="Configure Gaphor"
user_options = [
- ('pkg-config=', None, 'Path to pkg-config'),
+ #('pkg-config=', None, 'Path to pkg-config'),
]
- pkg_config_checked=False
- config_failed=False
+ #pkg_config_checked=False
+ config_failed=[]
def initialize_options(self):
- self.pkg_config = 'pkg-config'
+ #self.pkg_config = 'pkg-config'
+ pass
def finalize_options(self):
# Check for existence of pkg-config
- status, output = getstatusoutput('%s --version' % self.pkg_config)
- if status != 0:
- print 'pkg-config not found.'
- raise SystemExit
- print 'Found pkg-config version %s' % output
+ #status, output = getstatusoutput('%s --version' % self.pkg_config)
+ #if status != 0:
+ # print 'pkg-config not found.'
+ # raise SystemExit
+ #print 'Found pkg-config version %s' % output
+ pass
def run(self):
#self.pkg_config_check('gobject-2.0', '2.0.0')
@@ -63,25 +65,34 @@ def run(self):
#self.pkg_config_check('diacanvas2', '0.9.1')
self.module_check('xml.parsers.expat')
- self.module_check('gobject')
+ #self.module_check('gobject', 'glib_version', (2, 0))
+ self.module_check('gtk', 'gtk_version', (2, 0),
+ 'pygtk_version', (1, 99, 16))
self.module_check('gnome')
self.module_check('gnome.ui')
self.module_check('gnome.canvas')
self.module_check('bonobo')
self.module_check('bonobo.ui')
self.module_check('gconf')
- self.module_check('diacanvas')
+ self.module_check('diacanvas', 'diacanvas_version', (0, 9, 2))
+ print ''
if self.config_failed:
print 'Config failed.'
+ print 'The following modules can not be found or are to old:'
+ print ' ', str(self.config_failed)[1:-1]
+ print ''
raise SystemExit
+ else:
+ print 'Config succeeded.'
+ print 'You can run Gaphor by typing: python setup.py run'
def pkg_config_check(self, package, version):
"""Check for availability of a package via pkg-config."""
retval = os.system('%s --exists %s' % (self.pkg_config, package))
if retval:
print '!!! Required package %s not found.' % package
- self.config_failed = True
+ self.config_failed.append(package)
return
pkg_version_str = getoutput('%s --modversion %s' % (self.pkg_config, package))
pkg_version = map(int, pkg_version_str.split('.'))
@@ -90,17 +101,40 @@ def pkg_config_check(self, package, version):
print "Found '%s', version %s." % (package, pkg_version_str)
else:
print "!!! Package '%s' has version %s, should have at least version %s." % ( package, pkg_version_str, version )
- self.config_failed = True
+ self.config_failed.append(package)
+
+ def module_check(self, module, *version_checks):
+ """Check for the availability of a module.
- def module_check(self, module):
+ version_checks is a set of ket/version pairs that should be true.
+ """
try:
- __import__(module)
+ mod = __import__(module)
except ImportError:
print "!!! Required module '%s' not found." % module
- self.config_failed = True
+ self.config_failed.append(module)
else:
print "Module '%s' found." % module
-
+ while version_checks:
+ self.version_check(mod, version_checks[0], version_checks[1])
+ version_checks = version_checks[2:]
+
+ def version_check(self, module, key, ver):
+ import string
+ s_ver = string.join(map(str, ver), '.')
+ print " Checking key '%s.%s' >= %s..." % (module.__name__, key, s_ver),
+ try:
+ modver = getattr(module, key)
+ except:
+ print "Not found." % key
+ self.config_failed.append(module.__name__)
+ else:
+ s_modver = string.join(map(str, modver), '.')
+ if modver >= ver:
+ print "Okay (%s)." % s_modver
+ else:
+ print "Failed (%s)" % s_modver
+ self.config_failed.append(module.__name__)
class build_py_Gaphor(build_py):

0 comments on commit 6d06a37

Please sign in to comment.
Something went wrong with that request. Please try again.