Changeset 193

Show
Ignore:
Timestamp:
04/01/03 10:33:35 (6 years ago)
Author:
arjanmol
Message:

*** empty log message ***

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/gaphor/ChangeLog

    r192 r193  
     12002-03-31  Arjan Molenaar  <arjanmolenaar@hetnet.nl> 
     2 
     3        * setup.py: check versions of modules. 
     4 
    152002-03-22  Arjan Molenaar  <arjanmolenaar@hetnet.nl> 
    26 
  • trunk/gaphor/TODO

    r191 r193  
    88- Items visible/hidden doesn't work properly when opening a diagram. 
    99 
    10 --- 
    11 It seems like PyObject's do not live as long as GObject objects. Once a PyObject 
    12 object has no references to itself, it can be destroyed (or at least it's 
    13 dictionary can). This should have been prevented in the pygobject_dealloc() 
    14 function in the PyGTK package. For most items there is no problem, since they 
    15 are referenced by a UML modelelement. Some, such as CommentLineItem, end up 
    16 with an empty dictionary after loading. 
    17  
    18 Currently gaphor/storage.py contains a lot of debug stuff, COmmentLineItem uses 
    19 get/set_data to store its id. 
    20 --- 
    2110- Diagram items should be created for lots of model elements 
    2211  (we currently have Actor, UseCase, Comment and the fancy line that connects 
     
    4231- A more pattern driven design (using Factories, Singletons etc.). We're doing 
    4332  a pretty good job already, though... 
    44 - Add features to classes (attribute and operation). 
    45  
     33- Let commands determine if they are visible/sensible, instead of a 
     34  has_capability function on the diagram item. 
    4635- Create a Classifier item, which should function as superclass for Class, 
    4736  Interface, Stereotype, Datatype, etc. 
  • trunk/gaphor/data/gaphor-diagram-ui.xml

    r185 r193  
    6161        <!-- Generic popup menu: --> 
    6262        <popup name="DiagramView"> 
    63             <menuitem name="EditDelete" verb=""/> 
    64             <separator/> 
    6563            <!-- For classes: --> 
    6664            <menuitem name="CreateAttribute" verb=""/> 
     
    7371            <menuitem name="Orthogonal" verb="" type="toggle"/> 
    7472            <separator/> 
     73            <menuitem name="EditDelete" verb=""/> 
     74            <menuitem name="DeleteAttribute" verb=""/> 
     75            <menuitem name="DeleteOperation" verb=""/> 
     76            <separator/> 
    7577            <menuitem name="SnapToGrid" verb="" type="toggle"/> 
    7678        </popup> 
     
    7981             item they are meny to be used for. --> 
    8082        <popup name="Association"> 
    81             <menuitem name="EditDelete" verb=""/> 
    82             <separator/> 
    8383            <menuitem name="AddSegment" verb=""/> 
    8484            <menuitem name="DeleteSegment" verb=""/> 
     
    8686            <separator/> 
    8787            <submenu _label="Side A"> 
     88                <menuitem name="Head_isNavigable" verb="" type="toggle"/> 
     89                <separator/> 
     90                <menuitem name="Head_None" verb="" type="radio" group="ak_head"/> 
     91                <menuitem name="Head_Aggregate" verb="" type="radio" group="ak_head"/> 
     92                <menuitem name="Head_Composite" verb="" type="radio" group="ak_head"/> 
     93            </submenu> 
     94            <submenu _label="Side B"> 
    8895                <menuitem name="Tail_isNavigable" verb="" type="toggle"/> 
    8996                <separator/> 
     
    9299                <menuitem name="Tail_Composite" verb="" type="radio" group="ak_tail"/> 
    93100            </submenu> 
    94             <submenu _label="Side B"> 
    95                 <menuitem name="Head_isNavigable" verb="" type="toggle"/> 
    96                 <separator/> 
    97                 <menuitem name="Head_None" verb="" type="radio" group="ak_head"/> 
    98                 <menuitem name="Head_Aggregate" verb="" type="radio" group="ak_head"/> 
    99                 <menuitem name="Head_Composite" verb="" type="radio" group="ak_head"/> 
    100             </submenu> 
     101            <separator/> 
     102            <menuitem name="EditDelete" verb=""/> 
    101103            <separator/> 
    102104            <menuitem name="SnapToGrid" verb="" type="toggle"/> 
  • trunk/gaphor/gaphor/ui/commandregistry.py

    r185 r193  
    1717 
    1818    def __call__(self, ui_component, name, type=-1, state=0): 
    19         print 'CommandExecuter.__call__:', ui_component, name, type, state 
     19        #print 'CommandExecuter.__call__:', ui_component, name, type, state 
    2020        if not self.executing: 
    2121            self.executing = 1 
  • trunk/gaphor/gaphor/ui/diagramwindow.py

    r191 r193  
    7373        self._construct_window(name='diagram', 
    7474                               title=title, 
    75                                size=(400, 400), 
     75                               size=(550, 550), 
    7676                               contents=table, 
    7777                               params={ 'window': self }) 
  • trunk/gaphor/setup.py

    r191 r193  
    3737 
    3838    user_options = [ 
    39         ('pkg-config=', None, 'Path to pkg-config'), 
     39        #('pkg-config=', None, 'Path to pkg-config'), 
    4040    ] 
    4141 
    42     pkg_config_checked=False 
    43     config_failed=False 
     42    #pkg_config_checked=False 
     43    config_failed=[] 
    4444 
    4545    def initialize_options(self): 
    46         self.pkg_config = 'pkg-config' 
     46        #self.pkg_config = 'pkg-config' 
     47        pass 
    4748 
    4849    def finalize_options(self): 
    4950        # Check for existence of pkg-config 
    50         status, output = getstatusoutput('%s --version' % self.pkg_config) 
    51         if status != 0: 
    52             print 'pkg-config not found.' 
    53             raise SystemExit 
    54         print 'Found pkg-config version %s' % output 
     51        #status, output = getstatusoutput('%s --version' % self.pkg_config) 
     52        #if status != 0: 
     53        #    print 'pkg-config not found.' 
     54        #    raise SystemExit 
     55        #print 'Found pkg-config version %s' % output 
     56        pass 
    5557 
    5658    def run(self): 
     
    6466 
    6567        self.module_check('xml.parsers.expat') 
    66         self.module_check('gobject') 
     68        #self.module_check('gobject', 'glib_version', (2, 0)) 
     69        self.module_check('gtk', 'gtk_version', (2, 0), 
     70                                 'pygtk_version', (1, 99, 16)) 
    6771        self.module_check('gnome') 
    6872        self.module_check('gnome.ui') 
     
    7175        self.module_check('bonobo.ui') 
    7276        self.module_check('gconf') 
    73         self.module_check('diacanvas') 
    74  
     77        self.module_check('diacanvas', 'diacanvas_version', (0, 9, 2)) 
     78 
     79        print '' 
    7580        if self.config_failed: 
    7681            print 'Config failed.' 
     82            print 'The following modules can not be found or are to old:' 
     83            print ' ', str(self.config_failed)[1:-1] 
     84            print '' 
    7785            raise SystemExit 
     86        else: 
     87            print 'Config succeeded.' 
     88            print 'You can run Gaphor by typing: python setup.py run' 
    7889 
    7990    def pkg_config_check(self, package, version): 
     
    8293        if retval: 
    8394            print '!!! Required package %s not found.' % package 
    84             self.config_failed = True 
     95            self.config_failed.append(package) 
    8596            return 
    8697        pkg_version_str = getoutput('%s --modversion %s' % (self.pkg_config, package)) 
     
    91102        else: 
    92103            print "!!! Package '%s' has version %s, should have at least version %s." % ( package, pkg_version_str, version ) 
    93             self.config_failed = True 
    94  
    95     def module_check(self, module): 
     104            self.config_failed.append(package) 
     105 
     106    def module_check(self, module, *version_checks): 
     107        """Check for the availability of a module. 
     108 
     109        version_checks is a set of ket/version pairs that should be true. 
     110        """ 
    96111        try: 
    97             __import__(module) 
     112            mod = __import__(module) 
    98113        except ImportError: 
    99114            print "!!! Required module '%s' not found." % module 
    100             self.config_failed = True 
     115            self.config_failed.append(module) 
    101116        else: 
    102117            print "Module '%s' found." % module 
    103  
     118            while version_checks: 
     119                self.version_check(mod, version_checks[0], version_checks[1]) 
     120                version_checks = version_checks[2:] 
     121 
     122    def version_check(self, module, key, ver): 
     123        import string 
     124        s_ver = string.join(map(str, ver), '.') 
     125        print "  Checking key '%s.%s' >= %s..." % (module.__name__, key, s_ver), 
     126        try: 
     127            modver = getattr(module, key) 
     128        except: 
     129            print "Not found." % key 
     130            self.config_failed.append(module.__name__) 
     131        else: 
     132            s_modver = string.join(map(str, modver), '.') 
     133            if modver >= ver: 
     134                print "Okay (%s)." % s_modver 
     135            else: 
     136                print "Failed (%s)" % s_modver 
     137                self.config_failed.append(module.__name__) 
    104138 
    105139class build_py_Gaphor(build_py):