~ubuntu-branches/ubuntu/trusty/bittornado/trusty-proposed

« back to all changes in this revision

Viewing changes to debian/patches/25_errors_in_error_handling.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Cameron Dale
  • Date: 2008-07-19 16:08:44 UTC
  • mfrom: (0.1.14 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080719160844-nnmp02ar9pri55v1
Tags: 0.3.18-7
* Refresh all the quilt patches (Closes: #485320)
* Update standards version to 3.8.0
  - Add a README.source file pointing to the quilt documentation
* medium urgency to get it into lenny

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## 25_errors_in_error_handling.dpatch by Cameron Dale <camrdale@gmail.com>
 
3
##
 
4
## All lines beginning with `## DP:' are a description of the patch.
 
5
## DP: Fix a bug in the error handling of btdownloadcurses/headless.
 
6
 
 
7
@DPATCH@
 
8
--- bittornado.orig/btdownloadcurses.py
 
9
+++ bittornado/btdownloadcurses.py
 
10
@@ -162,10 +162,14 @@
 
11
         self.downRate = '---'
 
12
         self.display(fractionDone = 1)
 
13
 
 
14
-    def failed(self):
 
15
+    def failed(self, errormsg = None):
 
16
         self.done = 1
 
17
         self.activity = 'download failed!'
 
18
         self.downRate = '---'
 
19
+        if errormsg:
 
20
+            newerrmsg = strftime('[%H:%M:%S] ') + errormsg
 
21
+            self.errors.append(newerrmsg)
 
22
+            self.errlist.append(newerrmsg)
 
23
         self.display()
 
24
 
 
25
     def error(self, errormsg):
 
26
--- bittornado.orig/btdownloadheadless.py
 
27
+++ bittornado/btdownloadheadless.py
 
28
@@ -74,11 +74,13 @@
 
29
         self.downRate = ''
 
30
         self.display()
 
31
 
 
32
-    def failed(self):
 
33
+    def failed(self, errormsg = None):
 
34
         self.done = True
 
35
         self.percentDone = '0'
 
36
         self.timeEst = 'Download Failed!'
 
37
         self.downRate = ''
 
38
+        if errormsg:
 
39
+            self.errors.append(errormsg)
 
40
         self.display()
 
41
 
 
42
     def error(self, errormsg):