def startpytof(self, widget): po = pytofOptions() if not po.options.fromDir: # not from command line if not self.dir: sys.exit(1) else: po.options.fromDir = self.dir localEncoding = sys.stdout.encoding if localEncoding == 'cp850': po.options.fromDir = po.options.fromDir.encode('latin1') print po.options.fromDir po.check() progress = ProgressMsg(-1, self.pbar) pytof = Pytof(po, progress) pytof.main()
import psyco psyco.full() except ImportError: pass po = PytofOptions() po.check() # FIXME: there's gonna be a problem if we have a a comma # in the album name. for album in po.options.albumName.split(','): po.options.albumName = album progress = ProgressMsg(-1, sys.stderr) pytof = Pytof(po, progress) if po.options.pyprofile: # FIXME: factorize me in utils from profile import Profile myprofiler = Profile() myprofiler.create_stats() myprofiler.runcall(pytof.main) from tempfile import mktemp statfile = mktemp() myprofiler.dump_stats(statfile) import pstats p = pstats.Stats(statfile)