Codebase list twms / 87ec210
Add .gpx.bz2 patch. Andrew Shadura 11 years ago
4 changed file(s) with 43 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
0 twms (0.04r-2) experimental; urgency=low
1
2 * Apply upstream patch to handle bz2-compressed GPX tracks.
3 * Recommend python-cairo.
4
5 -- Andrew Shadura <andrewsh@debian.org> Mon, 08 Apr 2013 10:21:52 +0200
6
07 twms (0.04r-1) experimental; urgency=low
18
29 * New upstream release.
1010 Package: twms
1111 Architecture: all
1212 Depends: ${misc:Depends}, ${python:Depends}, python-imaging (>= 1.1.6), python-webpy (>= 1:0.33), adduser
13 Recommends: python-pyproj (>= 1.8.6)
13 Recommends: python-pyproj (>= 1.8.6), python-cairo
1414 Provides: python-twms
1515 Description: tiny web map service
1616 tWMS is a tiny WMS server for exporting your map
0 From: Andrew Shadura <bugzilla@tut.by>
1 Subject: Handle bz2-compressed GPX files (osm.org now generates them)
2
3 diff --git a/twms/gpxparse.py b/twms/gpxparse.py
4 --- a/twms/gpxparse.py
5 +++ b/twms/gpxparse.py
6 @@ -14,7 +14,7 @@
7 # You should have received a copy of the GNU General Public License
8 # along with tWMS. If not, see <http://www.gnu.org/licenses/>.
9
10 -import sys, string
11 +import sys, string, bz2, os
12 from xml.dom import minidom, Node
13
14 class GPXParser:
15 @@ -24,7 +24,16 @@ class GPXParser:
16 self.trknum = 0
17 self.bbox = (999,999,-999,-999)
18 try:
19 - doc = minidom.parse(filename)
20 + file = bz2.BZ2File(filename)
21 + file.read(1)
22 + file.seek(0, os.SEEK_SET)
23 + except:
24 + try:
25 + file = open(filename)
26 + except:
27 + return
28 + try:
29 + doc = minidom.parse(file)
30 doc.normalize()
31 except:
32 return # handle this properly later
33
00 03_remove_path.patch
1 gpx-bz.patch