~ubuntu-branches/debian/sid/bittornado/sid

« back to all changes in this revision

Viewing changes to debian/patches/14_enable_gui_commandline.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Cameron Dale
  • Date: 2006-10-27 15:46:48 UTC
  • Revision ID: james.westby@ubuntu.com-20061027154648-1ylnpnjdl401otda
* New upstream release (Closes: #395326)
  . Fixes BitTorrent engine error (Closes: #385721)
  . Fixes problem with super-seeding
* Fix the ipv6 in SocketHandler.py (Closes: #305388)
  (thanks to Tobias Diedrich for this fix)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## 14_enable_gui_commandline.dpatch by  <camrdale@gmail.com>
 
3
##
 
4
## All lines beginning with `## DP:' are a description of the patch.
 
5
## DP: Enable the gui commandline parameters for btdownloadgui.
 
6
 
 
7
@DPATCH@
 
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
 
11
@@ -256,6 +256,16 @@
 
12
     return config
 
13
 
 
14
 
 
15
+def parse_params_gui(params, presets = {}):
 
16
+    config, args = parseargs(params, defaults, 0, 1, presets = presets)
 
17
+    if args:
 
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'
 
22
+    return config
 
23
+
 
24
+
 
25
 def get_usage(defaults = defaults, cols = 100, presets = {}):
 
26
     return (argslistheader + formatDefinitions(defaults, cols, presets))
 
27
 
 
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
 
31
@@ -21,7 +21,7 @@
 
32
 except:
 
33
     print 'wxPython is either not installed or has not been installed properly.'
 
34
     exit(1)
 
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 @@
 
41
     def OnInit(self):
 
42
         doneflag = Event()
 
43
         self.configfile = configReader()
 
44
+        try:            
 
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'
 
48
+            exit(1)
 
49
+
 
50
         d = DownloadInfoFrame(doneflag, self.configfile)
 
51
         self.SetTopWindow(d.frame)
 
52
         if len(self.params) == 0: