diff options
author | Benjamin Saller <bcsaller@objectrealms.net> | 2007-05-18 21:35:34 (GMT) |
---|---|---|
committer | Benjamin Saller <bcsaller@objectrealms.net> | 2007-05-18 21:35:34 (GMT) |
commit | e898535c1226ebe6bf3c080d195ec3b1b22f9cd0 (patch) | |
tree | 5adc68437fcf23a0af0cfd96c67ed45b653b000f /src/olpc/datastore/datastore.py | |
parent | 06fa630258b5600f3c4068ea579aec23e9cdb1d3 (diff) |
verify indexing works with non-ascii files, all tests pass
Diffstat (limited to 'src/olpc/datastore/datastore.py')
-rw-r--r-- | src/olpc/datastore/datastore.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/olpc/datastore/datastore.py b/src/olpc/datastore/datastore.py index 7eb790e..b95a274 100644 --- a/src/olpc/datastore/datastore.py +++ b/src/olpc/datastore/datastore.py @@ -99,13 +99,14 @@ class DataStore(dbus.service.Object): new objects are created in the first datastore. More control over this process can come at a later time. """ + filename = filelike if filelike: if isinstance(filelike, basestring): # lets treat it as a filename filelike = open(filelike, "r") t = filelike.tell() - content = self.querymanager.create(props, filelike) + content = self.querymanager.create(props, filename) if filelike: filelike.seek(t) @@ -176,12 +177,15 @@ class DataStore(dbus.service.Object): given uid. If contents have been written to another file for example. You must create it """ + filename = filelike if filelike: if isinstance(filelike, basestring): filelike = open(filelike, 'r') + + content = self.get(uid) if content: - self.querymanager.update(uid, props, filelike) + self.querymanager.update(uid, props, filename) if filelike: self.backingstore.set(uid, filelike) self.emitter('update', content.id, props, signature="sa{sv}") logger.debug("updated %s" % content.id) |