diff options
author | hut <hut@lavabit.com> | 2012-08-14 16:09:32 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2012-08-14 16:09:32 +0200 |
commit | 8a13baa3dfd2922672b5feca01b2b81d8058c903 (patch) | |
tree | 6a1640416b4a038496a29fea2365c81d26ae3ef4 | |
parent | 6e37c9520e9365f717d0e40c89cc71663eb2f80d (diff) | |
download | ranger-8a13baa3dfd2922672b5feca01b2b81d8058c903.tar.gz |
ranger.__init__: cleaner ranger.log()
-rw-r--r-- | ranger/__init__.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ranger/__init__.py b/ranger/__init__.py index ea94f53c..3d56e052 100644 --- a/ranger/__init__.py +++ b/ranger/__init__.py @@ -42,10 +42,10 @@ def log(*objects, **keywords): """ from ranger import arg if LOGFILE is None or not arg.debug or arg.clean: return - start = 'start' in keywords and keywords['start'] or 'ranger:' - sep = 'sep' in keywords and keywords['sep'] or ' ' - _file = 'file' in keywords and keywords['file'] or open(LOGFILE, 'a') - end = 'end' in keywords and keywords['end'] or '\n' + start = keywords.get('start', 'ranger:') + sep = keywords.get('sep', ' ') + end = keywords.get('end', '\n') + _file = keywords['file'] if 'file' in keywords else open(LOGFILE, 'a') _file.write(sep.join(map(str, (start, ) + objects)) + end) |