From bbb9075e51bcc073af9233df83097915515073d0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Matox?= Date: Mon, 27 Oct 2008 16:55:53 +0000 Subject: [PATCH] Adjust profiling to new lyx2lyx call git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27155 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/lyx2lyx/lyx2lyx | 5 ++++- lib/lyx2lyx/profiling.py | 7 +++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/lyx2lyx/lyx2lyx b/lib/lyx2lyx/lyx2lyx index d2e5a090d9..3a040a67d0 100755 --- a/lib/lyx2lyx/lyx2lyx +++ b/lib/lyx2lyx/lyx2lyx @@ -22,7 +22,7 @@ import optparse import sys import LyX -if __name__ == "__main__": +def main(): args = {} args["usage"] = "usage: %prog [options] [file]" @@ -78,3 +78,6 @@ Copyright (C) 2007 José Matos and Dekel Tsur""" % LyX.version__ doc.write() sys.exit(doc.status) + +if __name__ == "__main__": + main() diff --git a/lib/lyx2lyx/profiling.py b/lib/lyx2lyx/profiling.py index b97bc22d1b..fbdb10a2c7 100755 --- a/lib/lyx2lyx/profiling.py +++ b/lib/lyx2lyx/profiling.py @@ -35,11 +35,10 @@ Example: ./profiling.py -ou.lyx ../doc/UserGuide.lyx """ -def main(argv): +def main(): # This will only work with python >= 2.2, the version where this module was added prof = hotshot.Profile("lyx2lyx.prof") # Use temporary file, here? - benchtime = prof.runcall( - lambda : lyx2lyx.main(argv)) + benchtime = prof.runcall(lyx2lyx.main) prof.close() # After the tests, show the profile analysis. @@ -52,4 +51,4 @@ def main(argv): if __name__ == "__main__": - main(sys.argv) + main() -- 2.39.5