Example #1
0
 def _dump_config(self):
     configfile.save_ui_config(self.config, 'bittorrent',
                            self.ui_options, self.global_error)
     for infohash,t in self.torrents.items():
         ec = lambda level, message: self.error(t.metainfo, level, message)
         config = t.config.getDict()
         if config:
             configfile.save_torrent_config(self.config['data_dir'],
                                            infohash, config, ec)
Example #2
0
 def _dump_config(self):
     configfile.save_ui_config(self.config, 'bittorrent', self.ui_options,
                               self.global_error)
     for infohash, t in self.torrents.items():
         ec = lambda level, message: self.error(t.metainfo, level, message)
         config = t.config.getDict()
         if config:
             configfile.save_torrent_config(self.config['data_dir'],
                                            infohash, config, ec)
                        self.set_progress_value,
                        self.set_file,
                        self.piece_length)
            if not self.flag.isSet():
                self.set_title('Done.')
                self.label.set_text('Done building torrents.')
                self.set_progress_value(1)
                self.action_area.remove(self.cancelbutton)
                self.action_area.pack_start(self.done_button)
                self.done_button.show()
        except (OSError, IOError), e:
            self.set_title('Error!')
            self.label.set_text('Error building torrents: ' + str(e))


if __name__ == '__main__':

    config, args = configfile.parse_configuration_and_args(defaults,
                                    'btmaketorrentgui', sys.argv[1:], 0, None)
    w = MainWindow(config)
    try:
        gtk.main()
    except KeyboardInterrupt:
        # gtk.mainloop not running
        # exit and don't save config options
        sys.exit(1)

    save_options = ('torrent_dir','piece_size_pow2','tracker_name')
    def error_callback(error, string): print string
    configfile.save_ui_config(w.config, 'btmaketorrentgui', save_options, error_callback)
Example #4
0
 def _dump_config(self):
     configfile.save_ui_config(self.config, 'btdownloadgui',
                            self.ui_options, self.global_error)
Example #5
0
 def _dump_config(self):
     configfile.save_ui_config(self.config, 'btdownloadgui',
                            self.ui_options, self.global_error)
Example #6
0
                self.set_title('Done.')
                self.label.set_text('Done building torrents.')
                self.set_progress_value(1)
                self.action_area.remove(self.cancelbutton)
                self.action_area.pack_start(self.done_button)
                self.done_button.show()
        except (OSError, IOError), e:
            self.set_title('Error!')
            self.label.set_text('Error building torrents: ' + str(e))


if __name__ == '__main__':

    config, args = configfile.parse_configuration_and_args(
        defaults, 'btmaketorrentgui', sys.argv[1:], 0, None)
    w = MainWindow(config)
    try:
        gtk.main()
    except KeyboardInterrupt:
        # gtk.mainloop not running
        # exit and don't save config options
        sys.exit(1)

    save_options = ('torrent_dir', 'piece_size_pow2', 'tracker_name')

    def error_callback(error, string):
        print string

    configfile.save_ui_config(w.config, 'btmaketorrentgui', save_options,
                              error_callback)
Example #7
0
 def save_config(self):
     def error_callback(error, string): print string
     configfile.save_ui_config(self.config, 'maketorrent', ui_options, error_callback)