Permalink
Browse files

ranger.__init__: cleaner ranger.log()

  • Loading branch information...
1 parent 6e37c95 commit 8a13baa3dfd2922672b5feca01b2b81d8058c903 @hut hut committed Aug 14, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 ranger/__init__.py
View
@@ -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)

0 comments on commit 8a13baa

Please sign in to comment.