1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 14_enable_gui_commandline.dpatch by <camrdale@gmail.com>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: Enable the gui commandline parameters for btdownloadgui.
8
diff -urNad bittornado~/BitTornado/download_bt1.py bittornado/BitTornado/download_bt1.py
9
--- bittornado~/BitTornado/download_bt1.py 2006-10-27 16:52:10.000000000 -0700
10
+++ bittornado/BitTornado/download_bt1.py 2006-10-27 16:52:11.000000000 -0700
15
+def parse_params_gui(params, presets = {}):
16
+ config, args = parseargs(params, defaults, 0, 1, presets = presets)
18
+ if config['responsefile'] or config['url']:
19
+ raise ValueError,'must have responsefile or url as arg or parameter, not both'
20
+ elif (config['responsefile'] and config['url']):
21
+ raise ValueError, 'cannot have both responsefile and url'
25
def get_usage(defaults = defaults, cols = 100, presets = {}):
26
return (argslistheader + formatDefinitions(defaults, cols, presets))
28
diff -urNad bittornado~/btdownloadgui.py bittornado/btdownloadgui.py
29
--- bittornado~/btdownloadgui.py 2006-10-27 16:51:07.000000000 -0700
30
+++ bittornado/btdownloadgui.py 2006-10-27 16:52:11.000000000 -0700
33
print 'wxPython is either not installed or has not been installed properly.'
35
-from BitTornado.download_bt1 import BT1Download, defaults, parse_params, get_usage, get_response
36
+from BitTornado.download_bt1 import BT1Download, defaults, parse_params, parse_params_gui, get_usage, get_response
37
from BitTornado.RawServer import RawServer, UPnP_ERROR
38
from random import seed
39
from socket import error as socketerror
40
@@ -2191,6 +2191,12 @@
43
self.configfile = configReader()
45
+ self.configfile.config = parse_params_gui(self.params, self.configfile.config)
46
+ except ValueError, e:
47
+ print 'error: ' + str(e) + '\nrun with no args and cancel the open dialog for parameter explanations'
50
d = DownloadInfoFrame(doneflag, self.configfile)
51
self.SetTopWindow(d.frame)
52
if len(self.params) == 0: