~ubuntu-branches/ubuntu/raring/agtl/raring

« back to all changes in this revision

Viewing changes to debian/patches/0001-change-Exception-as-to-Exception-for-python2.5-compa.patch

  • Committer: Bazaar Package Importer
  • Author(s): Heiko Stuebner
  • Date: 2009-10-17 15:07:19 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20091017150719-khg6mg5o99upitof
Tags: 0.4.0+git20091011-1
* new upstream-snapshot
* patches updated accordingly
* incorporated Steffen Moellers fixes to the files in debian/

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From e2d88226e35eb08b459d01323a674f8a112f9528 Mon Sep 17 00:00:00 2001
 
1
From dfc4aa67abcbc87b8d24bda696d22fe823a5687f Mon Sep 17 00:00:00 2001
2
2
From: Heiko Stuebner <heiko@sntech.de>
3
 
Date: Wed, 9 Sep 2009 17:48:27 +0200
4
 
Subject: [PATCH 1/2] change "Exception as" to "Exception," for python2.5 compatibility
 
3
Date: Sun, 11 Oct 2009 22:14:23 +0200
 
4
Subject: [PATCH] python2.5 exception compatibility
5
5
 
6
6
---
7
 
 files/advancedcaching/core.py      |    8 ++++----
8
 
 files/advancedcaching/gpsreader.py |    2 +-
9
 
 files/advancedcaching/simplegui.py |    4 ++--
10
 
 3 files changed, 7 insertions(+), 7 deletions(-)
 
7
 files/advancedcaching/cli.py           |    8 ++++----
 
8
 files/advancedcaching/core.py          |   12 ++++++------
 
9
 files/advancedcaching/downloader.py    |    2 +-
 
10
 files/advancedcaching/geocaching.py    |    2 +-
 
11
 files/advancedcaching/gpsreader.py     |    2 +-
 
12
 files/advancedcaching/openstreetmap.py |    4 ++--
 
13
 files/advancedcaching/simplegui.py     |    2 +-
 
14
 7 files changed, 16 insertions(+), 16 deletions(-)
11
15
 
 
16
diff --git a/files/advancedcaching/cli.py b/files/advancedcaching/cli.py
 
17
index 42ed4f4..7d909d6 100644
 
18
--- a/files/advancedcaching/cli.py
 
19
+++ b/files/advancedcaching/cli.py
 
20
@@ -65,13 +65,13 @@ class Cli():
 
21
         
 
22
         try:
 
23
             self.parse_input()
 
24
-        except ParseError as e:
 
25
+        except ParseError, e:
 
26
             if e.token == None:
 
27
                 print "# Parse Error at token '%s': " % sys.argv[self.nt - 1]
 
28
             else:
 
29
                 print "# Parse Error after Token '%s':" % sys.argv[e.token]
 
30
             print "# %s" % e.msg
 
31
-        except RunError as e:
 
32
+        except RunError, e:
 
33
             print "# Execution Error at token '%s': " % sys.argv[self.nt - 1]
 
34
             print "# %s" % e.msg
 
35
             
 
36
@@ -254,12 +254,12 @@ class Cli():
 
37
             query = text[2:]
 
38
             try:
 
39
                 c = self.core.get_coord_by_name(query)
 
40
-            except Exception as e:
 
41
+            except Exception, e:
 
42
                 raise ParseError(e)
 
43
         else:
 
44
             try:
 
45
                 c = geo.try_parse_coordinate(text)
 
46
-            except Exception as e:
 
47
+            except Exception, e:
 
48
                 raise ParseError(e)
 
49
             
 
50
         return c
12
51
diff --git a/files/advancedcaching/core.py b/files/advancedcaching/core.py
13
 
index 65e314d..2a4a36b 100755
 
52
index 8b1a92a..c2275a2 100755
14
53
--- a/files/advancedcaching/core.py
15
54
+++ b/files/advancedcaching/core.py
16
 
@@ -82,7 +82,7 @@ class Standbypreventer():
 
55
@@ -174,7 +174,7 @@ class Standbypreventer():
17
56
     def __try_run(self, command):
18
 
        try:
19
 
            os.system(command)
20
 
-       except Exception as e:
21
 
+       except Exception, e:
22
 
            print "Could not prevent Standby: %s" % e
 
57
         try:
 
58
             os.system(command)
 
59
-        except Exception as e:
 
60
+        except Exception, e:
 
61
             print "Could not prevent Standby: %s" % e
23
62
 
24
63
 class Core():
25
 
@@ -204,7 +204,7 @@ class Core():
26
 
            self.pointprovider.add_point(full, True)
27
 
            exporter.export(full)
28
 
            self.pointprovider.save()
29
 
-       except Exception as e:
30
 
+       except Exception, e:
31
 
            self.gui.show_error(e)
32
 
        finally:
33
 
            self.gui.hide_progress()
34
 
@@ -250,7 +250,7 @@ class Core():
35
 
                exporter.export(full)
36
 
                i += 1.0
37
 
                                
38
 
-       except Exception as e:
39
 
+       except Exception, e:
40
 
            self.gui.show_error(e)
41
 
        finally:
42
 
            self.gui.hide_progress()
43
 
@@ -289,7 +289,7 @@ class Core():
44
 
                fn.add_fieldnote(c)
45
 
            fn.upload()
46
 
                        
47
 
-       except Exception as e:
48
 
+       except Exception, e:
49
 
            self.gui.show_error(e)
50
 
        else:
51
 
            #self.gui.show_success("Field notes uploaded successfully.")
 
64
@@ -282,7 +282,7 @@ class Core():
 
65
         cd = geocaching.CacheDownloader(self.downloader, self.settings['download_output_dir'], not self.settings['download_noimages'])
 
66
         try:
 
67
             caches = cd.get_geocaches(location)
 
68
-        except Exception as e:
 
69
+        except Exception, e:
 
70
             self.gui.show_error(e)
 
71
             print e
 
72
             return []
 
73
@@ -307,7 +307,7 @@ class Core():
 
74
             full = cd.update_coordinate(cache)
 
75
             self.pointprovider.add_point(full, True)
 
76
             self.pointprovider.save()
 
77
-        except Exception as e:
 
78
+        except Exception, e:
 
79
             self.gui.show_error(e)
 
80
             return cache
 
81
         finally:
 
82
@@ -319,7 +319,7 @@ class Core():
 
83
         try:
 
84
             exporter = geocaching.HTMLExporter(self.downloader, self.settings['download_output_dir'])
 
85
             exporter.export(cache, folder)
 
86
-        except Exception as e:
 
87
+        except Exception, e:
 
88
             self.gui.show_error(e)
 
89
         finally:
 
90
             self.gui.hide_progress()
 
91
@@ -366,7 +366,7 @@ class Core():
 
92
                 #exporter.export(full)
 
93
                 i += 1.0
 
94
                                 
 
95
-        except Exception as e:
 
96
+        except Exception, e:
 
97
             self.gui.show_error(e)
 
98
         finally:
 
99
             self.gui.hide_progress()
 
100
@@ -405,7 +405,7 @@ class Core():
 
101
                 fn.add_fieldnote(c)
 
102
             fn.upload()
 
103
                         
 
104
-        except Exception as e:
 
105
+        except Exception, e:
 
106
             self.gui.show_error(e)
 
107
         else:
 
108
             #self.gui.show_success("Field notes uploaded successfully.")
 
109
diff --git a/files/advancedcaching/downloader.py b/files/advancedcaching/downloader.py
 
110
index c2a9eb1..caba4ac 100644
 
111
--- a/files/advancedcaching/downloader.py
 
112
+++ b/files/advancedcaching/downloader.py
 
113
@@ -88,7 +88,7 @@ class FileDownloader():
 
114
         self.logged_in = True
 
115
         try:
 
116
             cj.save()
 
117
-        except Exception as e:
 
118
+        except Exception, e:
 
119
             print "+ Could not save cookies:", e
 
120
 
 
121
 
 
122
diff --git a/files/advancedcaching/geocaching.py b/files/advancedcaching/geocaching.py
 
123
index 25373e7..61cd2d5 100644
 
124
--- a/files/advancedcaching/geocaching.py
 
125
+++ b/files/advancedcaching/geocaching.py
 
126
@@ -325,7 +325,7 @@ class CacheDownloader():
 
127
                     im = Image.open(filename)
 
128
                     im.thumbnail((self.resize, self.resize), Image.ANTIALIAS)
 
129
                     im.save(filename)
 
130
-            except Exception as e:
 
131
+            except Exception, e:
 
132
                 print "could not download %s: %s" % (url, e)
 
133
                 return None
 
134
 
52
135
diff --git a/files/advancedcaching/gpsreader.py b/files/advancedcaching/gpsreader.py
53
 
index f0ac011..4ea7aa1 100644
 
136
index 1c385ac..a77fba1 100644
54
137
--- a/files/advancedcaching/gpsreader.py
55
138
+++ b/files/advancedcaching/gpsreader.py
56
 
@@ -104,7 +104,7 @@ class GpsReader():
57
 
                'sats': int(sats),
58
 
                'sats_known': sats_known
59
 
            }
60
 
-       except Exception as e:
61
 
+       except Exception, e:
62
 
            print "Fehler beim Auslesen der Daten: %s " % e
63
 
            return self.EMPTY
64
 
                        
 
139
@@ -168,7 +168,7 @@ class GpsReader():
 
140
                 quality = quality,
 
141
                 error = err_hor
 
142
                 )
 
143
-        except Exception as e:
 
144
+        except Exception, e:
 
145
             print "Fehler beim Auslesen der Daten: %s " % e
 
146
             return self.EMPTY
 
147
 
 
148
diff --git a/files/advancedcaching/openstreetmap.py b/files/advancedcaching/openstreetmap.py
 
149
index 215a9cb..df2a1bd 100644
 
150
--- a/files/advancedcaching/openstreetmap.py
 
151
+++ b/files/advancedcaching/openstreetmap.py
 
152
@@ -103,7 +103,7 @@ class TileLoader(threading.Thread):
 
153
             if self.pbuf.get_width() < self.gui.ts.tile_size() or self.pbuf.get_height() < self.gui.ts.tile_size():
 
154
                 raise Exception("Image too small, probably corrupted file")
 
155
             return True
 
156
-        except Exception as e:
 
157
+        except Exception, e:
 
158
             if tryno == 0:
 
159
                 return self.recover()
 
160
             else:
 
161
@@ -180,7 +180,7 @@ class TileLoader(threading.Thread):
 
162
                 print "File not found: %s" % remote
 
163
                 return False
 
164
             return True
 
165
-        except Exception as e:
 
166
+        except Exception, e:
 
167
             print "Download Error", e
 
168
             return False
 
169
         finally:
65
170
diff --git a/files/advancedcaching/simplegui.py b/files/advancedcaching/simplegui.py
66
 
index 3d5736e..f433f1b 100644
 
171
index e03978f..2419fb1 100644
67
172
--- a/files/advancedcaching/simplegui.py
68
173
+++ b/files/advancedcaching/simplegui.py
69
 
@@ -885,7 +885,7 @@ class SimpleGui():
70
 
                    images.append(os.path.join(self.settings['download_output_dir'], f))
71
 
                                
72
 
            self.images = images
73
 
-       except Exception as e:
74
 
+       except Exception, e:
75
 
            print "Could not prepare images: %s" % e
76
 
        self.update_cache_image(reset=True)
77
 
 
78
 
@@ -1156,7 +1156,7 @@ class SimpleGui():
79
 
 
80
 
            self.image_cache_caption.set_text("<b>%d</b> %s" % (self.image_no, caption))
81
 
            self.image_cache_caption.set_use_markup(True)
82
 
-       except Exception as e:
83
 
+       except Exception, e:
84
 
            print "Error loading image: %s" % e
85
 
                        
86
 
                
 
174
@@ -1282,7 +1282,7 @@ class SimpleGui(object):
 
175
 
 
176
             self.image_cache_caption.set_text("<b>%d</b> %s" % (self.image_no, caption))
 
177
             self.image_cache_caption.set_use_markup(True)
 
178
-        except Exception as e:
 
179
+        except Exception, e:
 
180
             print "Error loading image: %s" % e
 
181
                         
 
182
                 
87
183
-- 
88
184
1.6.3.3
89
185