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:
parent
8e9c883b73
commit
63cb58e75d
@ -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=()):
|
||||
"""
|
||||
|
@ -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()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user