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)
 
 
id='n134' href='#n134'>134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261