aboutsummaryrefslogtreecommitdiffstats
path: root/scanner/CachePath.py
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2011-05-23 05:25:45 -0400
committerJason A. Donenfeld <Jason@zx2c4.com>2011-05-23 05:25:45 -0400
commit4609fb54e8500f0c6968a1319d04466e1e193abc (patch)
tree8850e965bdc9a2ae312214abb1d775697160e085 /scanner/CachePath.py
parentPass jshint. (diff)
downloadPhotoFloat-4609fb54e8500f0c6968a1319d04466e1e193abc.tar.xz
PhotoFloat-4609fb54e8500f0c6968a1319d04466e1e193abc.zip
Better output on scanner.
Diffstat (limited to 'scanner/CachePath.py')
-rw-r--r--scanner/CachePath.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/scanner/CachePath.py b/scanner/CachePath.py
index 89fc20e..d7952f5 100644
--- a/scanner/CachePath.py
+++ b/scanner/CachePath.py
@@ -1,6 +1,17 @@
import os.path
from datetime import datetime
+def message(category, text):
+ if message.level <= 0:
+ sep = " "
+ else:
+ sep = "--"
+ print "%s %s%s[%s]%s%s" % (datetime.now().isoformat(), max(0, message.level) * " |", sep, category, max(1, (14 - len(category))) * " ", text)
+message.level = -1
+def next_level():
+ message.level += 1
+def back_level():
+ message.level -= 1
def set_cache_path_base(base):
trim_base.base = base
def untrim_base(path):