diff options
author | Sascha 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) |
commit | 3915c391918b48cfd9085bf02de3ae9ef59ea2a5 (patch) | |
tree | a7a896f966db0527e9ccbe1361ecfeb9affb0f7a | |
parent | 3228c5f7b99644f4adb3463f38f79ce896648311 (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-x | datastore-fuse.py | 3 |
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: |