Пример #1
0
    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()
Пример #2
0
    # 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)
	    os.remove(statfile) # remove temp file
	    p.strip_dirs()
	    p.sort_stats('cumulative').print_stats(30)

	else:

	    pytof.main()