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

« back to all changes in this revision

Viewing changes to debian/patches/0002-change-json-module-to-the-python2.5-equivalent-simpl.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 e67029c96f58222e51b76b8b524dc1397ac4ca8a Mon Sep 17 00:00:00 2001
 
1
From 85fb556f6e8e9d5fd6aec48475666e65a5d961e1 Mon Sep 17 00:00:00 2001
2
2
From: Heiko Stuebner <heiko@sntech.de>
3
 
Date: Wed, 9 Sep 2009 18:26:02 +0200
4
 
Subject: [PATCH 2/2] change json module to the python2.5 equivalent simplejson
 
3
Date: Sun, 11 Oct 2009 22:20:33 +0200
 
4
Subject: [PATCH] simplejson
5
5
 
6
6
---
7
7
 files/advancedcaching/core.py       |    6 +++---
9
9
 2 files changed, 10 insertions(+), 10 deletions(-)
10
10
 
11
11
diff --git a/files/advancedcaching/core.py b/files/advancedcaching/core.py
12
 
index 2a4a36b..e533cb4 100755
 
12
index 8b1a92a..83852b0 100755
13
13
--- a/files/advancedcaching/core.py
14
14
+++ b/files/advancedcaching/core.py
15
 
@@ -22,7 +22,7 @@
16
 
 
17
 
 ### For loading the conf file
18
 
 #from advancedcachinglib.geocaching import FieldnotesUploader
 
15
@@ -113,7 +113,7 @@ Just start the string with 'q:':
 
16
    
 
17
 
 
18
 
19
19
-import json
20
20
+import simplejson
21
21
 import sys
22
 
 import os
23
22
 
24
 
@@ -315,7 +315,7 @@ class Core():
25
 
        string = f.read()
26
 
        self.settings = {}
27
 
        if string != '':
28
 
-           tmp_settings = json.loads(string)
29
 
+           tmp_settings = simplejson.loads(string)
30
 
            for k, v in self.DEFAULT_SETTINGS.items():
31
 
                if k in tmp_settings.keys() != None:
32
 
                    self.settings[k] = tmp_settings[k]
33
 
@@ -337,7 +337,7 @@ class Core():
 
23
 import downloader
 
24
@@ -431,7 +431,7 @@ class Core():
 
25
         string = f.read()
 
26
         self.settings = {}
 
27
         if string != '':
 
28
-            tmp_settings = json.loads(string)
 
29
+            tmp_settings = simplejson.loads(string)
 
30
             for k, v in self.DEFAULT_SETTINGS.items():
 
31
                 if k in tmp_settings.keys() != None:
 
32
                     self.settings[k] = tmp_settings[k]
 
33
@@ -453,7 +453,7 @@ class Core():
34
34
     def __write_config(self):
35
 
        filename = os.path.join(self.SETTINGS_DIR, 'config')
36
 
        f = file(filename, 'w')
37
 
-       f.write(json.dumps(self.settings, sort_keys=True, indent=4))
38
 
+       f.write(simplejson.dumps(self.settings, sort_keys=True, indent=4))
 
35
         filename = os.path.join(self.SETTINGS_DIR, 'config')
 
36
         f = file(filename, 'w')
 
37
-        f.write(json.dumps(self.settings, sort_keys=True, indent=4))
 
38
+        f.write(simplejson.dumps(self.settings, sort_keys=True, indent=4))
39
39
 
40
40
 
41
41
 def determine_path ():
42
42
diff --git a/files/advancedcaching/geocaching.py b/files/advancedcaching/geocaching.py
43
 
index 40073a1..75d73d1 100644
 
43
index 25373e7..e882baa 100644
44
44
--- a/files/advancedcaching/geocaching.py
45
45
+++ b/files/advancedcaching/geocaching.py
46
 
@@ -1,7 +1,7 @@
47
 
 #!/usr/bin/python
48
 
 # -*- coding: utf-8 -*-
 
46
@@ -18,7 +18,7 @@
 
47
 #        Author: Daniel Fett advancedcaching@fragcom.de
 
48
 #
49
49
 
50
50
-import json
51
51
+import simplejson
52
52
 
53
53
 import geo
54
54
 import os
55
 
@@ -82,18 +82,18 @@ class GeocacheCoordinate(geo.Coordinate):
 
55
@@ -143,18 +143,18 @@ class GeocacheCoordinate(geo.Coordinate):
56
56
     def get_waypoints(self):
57
 
        if self.waypoints == None or self.waypoints == '':
58
 
            return []
59
 
-       return json.loads(self.waypoints)
60
 
+       return simplejson.loads(self.waypoints)
 
57
         if self.waypoints == None or self.waypoints == '':
 
58
             return []
 
59
-        return json.loads(self.waypoints)
 
60
+        return simplejson.loads(self.waypoints)
61
61
 
62
62
     def get_images(self):
63
 
        if self.images == None or self.images == '':
64
 
            return []
65
 
-       return json.loads(self.images)
66
 
+       return simplejson.loads(self.images)
 
63
         if self.images == None or self.images == '':
 
64
             return []
 
65
-        return json.loads(self.images)
 
66
+        return simplejson.loads(self.images)
67
67
 
68
68
     def set_waypoints(self, wps):
69
 
-       self.waypoints = json.dumps(wps)
70
 
+       self.waypoints = simplejson.dumps(wps)
 
69
-        self.waypoints = json.dumps(wps)
 
70
+        self.waypoints = simplejson.dumps(wps)
71
71
 
72
72
     def set_images(self, imgs):
73
 
-       self.images = json.dumps(imgs)
74
 
+       self.images = simplejson.dumps(imgs)
75
 
                
76
 
                
 
73
-        self.images = json.dumps(imgs)
 
74
+        self.images = simplejson.dumps(imgs)
 
75
                 
 
76
                 
77
77
     def was_downloaded(self):
78
 
@@ -260,7 +260,7 @@ class CacheDownloader():
79
 
        if match == None:
80
 
            raise Exception('Seite konnte nicht abgerufen werden')
81
 
        text = match.group(1).replace("\\'", "'")
82
 
-       a = json.loads(text.replace('\t', ' '))
83
 
+       a = simplejson.loads(text.replace('\t', ' '))
84
 
        points = []
85
 
        if not 'cc' in a['cs'].keys():
86
 
            return points
87
 
@@ -399,7 +399,7 @@ class HTMLExporter():
88
 
                
 
78
@@ -393,7 +393,7 @@ class CacheDownloader():
 
79
         if match == None:
 
80
             raise Exception('Seite konnte nicht abgerufen werden')
 
81
         text = match.group(1).replace("\\'", "'")
 
82
-        a = json.loads(text.replace('\t', ' '))
 
83
+        a = simplejson.loads(text.replace('\t', ' '))
 
84
         points = []
 
85
 
 
86
         if not 'cc' in a['cs'].keys():
 
87
@@ -553,7 +553,7 @@ class HTMLExporter():
 
88
                 
89
89
     def write_index(self, caches):
90
 
        b = [{'n': c.name, 't': c.title} for c in caches]
91
 
-       caches = json.dumps(b)
92
 
+       caches = simplejson.dumps(b)
93
 
        f = open(os.path.join(self.path, "index.html"), 'w')
94
 
        f.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"')
95
 
        f.write(' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">')
 
90
         b = [{'n': c.name, 't': c.title} for c in caches]
 
91
-        caches = json.dumps(b)
 
92
+        caches = simplejson.dumps(b)
 
93
         f = open(os.path.join(self.path, "index.html"), 'w')
 
94
         f.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"')
 
95
         f.write(' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">')
96
96
-- 
97
97
1.6.3.3
98
98