diff options
Diffstat (limited to 'ranger/__init__.py')
-rw-r--r-- | ranger/__init__.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ranger/__init__.py b/ranger/__init__.py index d2716895..f5a1c480 100644 --- a/ranger/__init__.py +++ b/ranger/__init__.py @@ -6,3 +6,25 @@ rangerdir = os.path.dirname(__file__) sys.path.append(confdir) + +def relpath(*args): + return os.path.join(rangerdir, *args) + +LOGFILE = '/tmp/errorlog' + +def log(txt): + f = open(LOGFILE, 'a') + f.write("r1: ") + f.write(str(txt)) + f.write("\n") + f.close() + +# used to get all colorschemes in ~/.ranger/colorschemes +# and ranger/colorschemes +def get_all(dirname): + import os + result = [] + for filename in os.listdir(dirname): + if filename.endswith('.py') and not filename.startswith('_'): + result.append(filename[0:filename.index('.')]) + return result |