def complete(self): try: if self.separatetorrents: completedir(self.d, self.a, self.params, self.flag, self.valcallback, self.filecallback) else: make_meta_file(self.d, self.a, self.params, self.flag, self.valcallback, progress_percent=1) if not self.flag.isSet(): self.currentLabel.SetLabel('Done!') self.gauge.SetValue(1000) self.button.SetLabel('Close') self.frame.Refresh() except (OSError, IOError), e: self.currentLabel.SetLabel('Error!') self.button.SetLabel('Close') dlg = wxMessageDialog(self.frame, message='Error - ' + str(e), caption='Error', style=wxOK | wxICON_ERROR) dlg.ShowModal() dlg.Destroy()
def complete(self): params = {'piece_size_pow2': self.pl} try: completedir(self.d, self.a, params, self.flag, self.valcallback, self.filecallback) if not self.flag.isSet(): self.currentLabel.SetLabel('Done!') self.gauge.SetValue(1000) self.button.SetLabel('Close') except (OSError, IOError), e: self.currentLabel.SetLabel('Error!') self.button.SetLabel('Close') dlg = wxMessageDialog(self.frame, message = 'Error - ' + str(e), caption = 'Error', style = wxOK | wxICON_ERROR) dlg.ShowModal() dlg.Destroy()
def complete(self): params = {'piece_size_pow2': self.pl} try: completedir(self.d, self.a, params, self.flag, self.valcallback, self.filecallback) if not self.flag.isSet(): self.currentLabel.SetLabel('Done!') self.gauge.SetValue(1000) self.button.SetLabel('Close') except (OSError, IOError), e: self.currentLabel.SetLabel('Error!') self.button.SetLabel('Close') dlg = wxMessageDialog(self.frame, message='Error - ' + str(e), caption='Error', style=wxOK | wxICON_ERROR) dlg.ShowModal() dlg.Destroy()
def complete(self): try: if self.separatetorrents: completedir(self.d, self.a, self.params, self.flag, self.valcallback, self.filecallback) else: make_meta_file(self.d, self.a, self.params, self.flag, self.valcallback, progress_percent = 1) if not self.flag.isSet(): self.currentLabel.SetLabel('Done!') self.gauge.SetValue(1000) self.button.SetLabel('Close') self.frame.Refresh() except (OSError, IOError), e: self.currentLabel.SetLabel('Error!') self.button.SetLabel('Close') dlg = wxMessageDialog(self.frame, message = 'Error - ' + str(e), caption = 'Error', style = wxOK | wxICON_ERROR) dlg.ShowModal() dlg.Destroy()
def main(argv): program, ext = os.path.splitext(os.path.basename(argv[0])) usage = "Usage: %s <trackerurl> <dir> [dir...] [params...]" % program desc = "Make a .torrent file for every file or directory present in " \ "each given directory" if len(argv) < 3: print "{}\n{}\n{}{}".format(usage, desc, formatDefinitions(defaults, 80), announcelist_details) return 2 try: config, args = parseargs(argv[1:], defaults, 2, None) for dir in args[1:]: completedir(dir, args[0], config) except ValueError as e: print 'error: ' + str(e) print 'run with no args for parameter explanations' return 1 return 0
try: import psyco assert psyco.__version__ >= 0x010100f0 psyco.full() except: pass from sys import argv, version, exit assert version >= '2', "Install Python 2.0 or greater" from os.path import split from BitTornado.BT1.makemetafile import defaults, completedir, print_announcelist_details from BitTornado.parseargs import parseargs, formatDefinitions if len(argv) < 3: a, b = split(argv[0]) print 'Usage: ' + b + ' <trackerurl> <dir> [dir...] [params...]' print 'makes a .torrent file for every file or directory present in each dir.' print print formatDefinitions(defaults, 80) print_announcelist_details() print('') exit(2) try: config, args = parseargs(argv[1:], defaults, 2, None) for dir in args[1:]: completedir(dir, args[0], config) except ValueError, e: print 'error: ' + str(e) print 'run with no args for parameter explanations'
import psyco assert psyco.__version__ >= 0x010100f0 psyco.full() except: pass from sys import argv, version, exit assert version >= '2', "Install Python 2.0 or greater" from os.path import split from BitTornado.BT1.makemetafile import defaults, completedir, print_announcelist_details from BitTornado.parseargs import parseargs, formatDefinitions if len(argv) < 3: a,b = split(argv[0]) print 'Usage: ' + b + ' <trackerurl> <dir> [dir...] [params...]' print 'makes a .torrent file for every file or directory present in each dir.' print print formatDefinitions(defaults, 80) print_announcelist_details() print ('') exit(2) try: config, args = parseargs(argv[1:], defaults, 2, None) for dir in args[1:]: completedir(dir, args[0], config) except ValueError, e: print 'error: ' + str(e) print 'run with no args for parameter explanations'