summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2012-08-14 16:09:32 +0200
committerhut <hut@lavabit.com>2012-08-14 16:09:32 +0200
commit8a13baa3dfd2922672b5feca01b2b81d8058c903 (patch)
tree6a1640416b4a038496a29fea2365c81d26ae3ef4
parent6e37c9520e9365f717d0e40c89cc71663eb2f80d (diff)
downloadranger-8a13baa3dfd2922672b5feca01b2b81d8058c903.tar.gz
ranger.__init__: cleaner ranger.log()
-rw-r--r--ranger/__init__.py8
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)
 
 
committer Kartik Agaram <vc@akkartik.com> 2018-09-21 13:51:43 -0700 4568' href='/akkartik/mu/commit/subx/edit?h=main&id=694d8485d49ecb4fb35c8cf0dacd59f960d2999e'>694d8485 ^
af21f7d1 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23