Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/jarabe/journal/model.py
diff options
context:
space:
mode:
authorSascha Silbe <sascha@silbe.org>2009-08-24 17:20:45 (GMT)
committer Tomeu Vizoso <tomeu@sugarlabs.org>2009-08-25 17:08:40 (GMT)
commit85b833960ded9148fbb42e773720ba3bcb02145e (patch)
treeac74034f36475b096307b091e78547aeb4f0eea7 /src/jarabe/journal/model.py
parent1f7d0394680aca0eabd9e6451b98bb141cd71c71 (diff)
add technical details to details view in Journal
Diffstat (limited to 'src/jarabe/journal/model.py')
-rw-r--r--src/jarabe/journal/model.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/jarabe/journal/model.py b/src/jarabe/journal/model.py
index 15259bb..02ce26a 100644
--- a/src/jarabe/journal/model.py
+++ b/src/jarabe/journal/model.py
@@ -420,6 +420,21 @@ def get_file(object_id):
else:
return None
+def get_file_size(object_id):
+ """Return the file size for an object
+ """
+ logging.debug('get_file_size %r', object_id)
+ if os.path.exists(object_id):
+ return os.stat(object_id).st_size
+
+ file_path = dbus_helpers.get_filename(object_id)
+ if file_path:
+ size = os.stat(file_path).st_size
+ os.remove(file_path)
+ return size
+
+ return 0
+
def get_unique_values(key):
"""Returns a list with the different values a property has taken
"""