Changeset 1271
- Timestamp:
- 05/11/07 11:31:33 (2 years ago)
- Files:
-
- gaphor/trunk/utils/command/run.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
gaphor/trunk/utils/command/run.py
r1238 r1271 19 19 ('model=', 'm', 'load a model file'), 20 20 ('coverage', None, 'Calculate coverage (utils/coverage.py)'), 21 ('profile', 'p', 'Run with profiling enabled'), 21 22 ] 22 23 … … 30 31 self.coverage = None 31 32 self.verbosity = 2 33 self.profile = None 32 34 33 35 def finalize_options(self): … … 37 39 def run(self): 38 40 print 'Starting Gaphor...' 41 39 42 if self.model: 40 43 print 'Starting with model file', self.model … … 105 108 print 'Launching Gaphor...' 106 109 #gaphor.main(self.model) 107 load_entry_point('gaphor==0.10.5', 'console_scripts', 'gaphor')() 110 starter = load_entry_point('gaphor==0.10.5', 'console_scripts', 'gaphor') 111 112 if self.profile: 113 print 'Enabling profiling...' 114 import hotshot, hotshot.stats 115 prof = hotshot.Profile('gaphor.prof') 116 prof.runcall(starter) 117 prof.close() 118 stats = hotshot.stats.load('gaphor.prof') 119 stats.strip_dirs() 120 stats.sort_stats('time', 'calls') 121 stats.print_stats(20) 122 else: 123 starter() 108 124 109 125 sub_commands = [('build', None)]
