Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2008-03-14 14:11:16 (GMT)
committer Jonas Smedegaard <dr@jones.dk>2008-03-14 14:15:56 (GMT)
commit385c4b40cba9fece7d3dac61cb6b1f65b08f1146 (patch)
treeb6ed47bfe9da5e6f0072a9c7a170bf7c4e52b998
parentfa5de8981c165b51fc2a41f59223e999c53fbaf2 (diff)
Fix quilt-separating patches.
-rw-r--r--debian/patches/1002_avoid_try-except-finally.patch68
-rw-r--r--docs/getbuildpath.py2
-rw-r--r--src/olpc/datastore/backingstore.py7
-rw-r--r--src/olpc/datastore/converter.py23
4 files changed, 83 insertions, 17 deletions
diff --git a/debian/patches/1002_avoid_try-except-finally.patch b/debian/patches/1002_avoid_try-except-finally.patch
index e69de29..863dc79 100644
--- a/debian/patches/1002_avoid_try-except-finally.patch
+++ b/debian/patches/1002_avoid_try-except-finally.patch
@@ -0,0 +1,68 @@
+--- sugar-datastore-0.8.0~git.13d354b.orig/src/olpc/datastore/backingstore.py
++++ sugar-datastore-0.8.0~git.13d354b/src/olpc/datastore/backingstore.py
+@@ -258,9 +258,10 @@
+ if os.path.exists(fn):
+ fp = open(fn, 'r')
+ try:
+- desc = pickle.load(fp)
+- except:
+- desc = {}
++ try:
++ desc = pickle.load(fp)
++ except:
++ desc = {}
+ finally:
+ fp.close()
+
+--- sugar-datastore-0.8.0~git.13d354b.orig/src/olpc/datastore/converter.py
++++ sugar-datastore-0.8.0~git.13d354b/src/olpc/datastore/converter.py
+@@ -74,17 +74,18 @@
+ cmd = self.raw % data
+
+ try:
+- cmd = cmd.split()
+- # the stderr capture here will hide glib error messages
+- # from converters which shouldn't be generating output anyway
+- retcode = subprocess.call(cmd, stderr=subprocess.PIPE)
+- if retcode: return None
+- return codecs.open(target, 'r', 'utf-8')
+- except UnicodeDecodeError:
+- # The data was an unknown type but couldn't be understood
+- # as text so we don't attempt to index it. This most
+- # likely means its just an unknown binary format.
+- return None
++ try:
++ cmd = cmd.split()
++ # the stderr capture here will hide glib error messages
++ # from converters which shouldn't be generating output anyway
++ retcode = subprocess.call(cmd, stderr=subprocess.PIPE)
++ if retcode: return None
++ return codecs.open(target, 'r', 'utf-8')
++ except UnicodeDecodeError:
++ # The data was an unknown type but couldn't be understood
++ # as text so we don't attempt to index it. This most
++ # likely means its just an unknown binary format.
++ return None
+ finally:
+ # we unlink the file as its already been opened for
+ # reading
+--- sugar-datastore-0.8.0~git.13d354b.orig/src/olpc/datastore/datastore.py
++++ sugar-datastore-0.8.0~git.13d354b/src/olpc/datastore/datastore.py
+@@ -412,11 +412,12 @@
+ backingstore = content.backingstore
+ backingstore.current_user_id = dbus.Bus().get_unix_user(sender)
+ try:
+- # Retrieving the file path for the file will cause the file to be
+- # copied or linked to a directory accessible by the caller.
+- file_path = content.filename
+- except AttributeError:
+- file_path = ''
++ try:
++ # Retrieving the file path for the file will cause the file to be
++ # copied or linked to a directory accessible by the caller.
++ file_path = content.filename
++ except AttributeError:
++ file_path = ''
+ finally:
+ backingstore.current_user_id = None
+ return file_path
diff --git a/docs/getbuildpath.py b/docs/getbuildpath.py
index 041dff1..d6e594a 100644
--- a/docs/getbuildpath.py
+++ b/docs/getbuildpath.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python2.4
import os, sys
# IF YOU ARE NOT GETTING THE RESULTS YOU EXPECT WHILE TESTING
diff --git a/src/olpc/datastore/backingstore.py b/src/olpc/datastore/backingstore.py
index 408c094..fc3c05f 100644
--- a/src/olpc/datastore/backingstore.py
+++ b/src/olpc/datastore/backingstore.py
@@ -258,10 +258,9 @@ class FileBackingStore(BackingStore):
if os.path.exists(fn):
fp = open(fn, 'r')
try:
- try:
- desc = pickle.load(fp)
- except:
- desc = {}
+ desc = pickle.load(fp)
+ except:
+ desc = {}
finally:
fp.close()
diff --git a/src/olpc/datastore/converter.py b/src/olpc/datastore/converter.py
index e739f22..75f7568 100644
--- a/src/olpc/datastore/converter.py
+++ b/src/olpc/datastore/converter.py
@@ -74,18 +74,17 @@ class subprocessconverter(object):
cmd = self.raw % data
try:
- try:
- cmd = cmd.split()
- # the stderr capture here will hide glib error messages
- # from converters which shouldn't be generating output anyway
- retcode = subprocess.call(cmd, stderr=subprocess.PIPE)
- if retcode: return None
- return codecs.open(target, 'r', 'utf-8')
- except UnicodeDecodeError:
- # The data was an unknown type but couldn't be understood
- # as text so we don't attempt to index it. This most
- # likely means its just an unknown binary format.
- return None
+ cmd = cmd.split()
+ # the stderr capture here will hide glib error messages
+ # from converters which shouldn't be generating output anyway
+ retcode = subprocess.call(cmd, stderr=subprocess.PIPE)
+ if retcode: return None
+ return codecs.open(target, 'r', 'utf-8')
+ except UnicodeDecodeError:
+ # The data was an unknown type but couldn't be understood
+ # as text so we don't attempt to index it. This most
+ # likely means its just an unknown binary format.
+ return None
finally:
# we unlink the file as its already been opened for
# reading