Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Silbe <sascha-pgp@silbe.org>2011-10-11 17:23:38 (GMT)
committer Sascha Silbe <sascha-pgp@silbe.org>2011-10-11 17:23:38 (GMT)
commit3915c391918b48cfd9085bf02de3ae9ef59ea2a5 (patch)
treea7a896f966db0527e9ccbe1361ecfeb9affb0f7a
parent3228c5f7b99644f4adb3463f38f79ce896648311 (diff)
Don't choke on numeric types for the timestamp property
Unlike sugar-datastore 0.84+, gdatastore currently returns properties as the same type they were sent when saving, rather than converting them all to strings. This means the timestamp property can be of a numeric type.
-rwxr-xr-xdatastore-fuse.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/datastore-fuse.py b/datastore-fuse.py
index e3e2f48..d127fed 100755
--- a/datastore-fuse.py
+++ b/datastore-fuse.py
@@ -68,6 +68,9 @@ class DataStoreObjectStat(fuse.Stat):
self.object_id = metadata['uid']
def _parse_time(self, timestamp):
+ if isinstance(timestamp, (int, float)):
+ return timestamp
+
try:
return int(timestamp, 10)
except ValueError: