added profiler, made modelfactory use 2.5 compliant import

git-svn-id: file:///Users/arjan/backup/gaphor/gaphor/trunk@2659 a8418922-720d-0410-834f-a69b97ada669
This commit is contained in:
Arjan Molenaar 2009-01-25 15:13:07 +00:00
parent 8e9c883b73
commit 63cb58e75d
3 changed files with 11 additions and 3 deletions

View File

@ -9,7 +9,7 @@ Functions collected in this module allow to
"""
import itertools
from .uml2 import *
from gaphor.UML.uml2 import *
def stereotypes_str(element, stereotypes=()):
"""

View File

@ -52,7 +52,15 @@ def main():
"""
import sys
if len(sys.argv) > 1:
launch(sys.argv[1])
if sys.argv[1] in ('-p', '--profile'):
print 'Starting profiler...'
import cProfile
import pstats
cProfile.run('import gaphor; gaphor.launch()', 'gaphor.prof')
p = pstats.Stats('gaphor.prof')
p.strip_dirs().sort_stats('time').print_stats(40)
else:
launch(sys.argv[1])
else:
launch()

View File

@ -209,7 +209,7 @@ It uses the GTK+ environment for user interaction.
'run': run,
},
setup_requires = ['nose == 0.9.3'] + platform_setup_requires,
setup_requires = ['nose >= 0.9.3'] + platform_setup_requires,
test_suite = 'nose.collector',