summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-12-23 19:53:42 +0100
committerhut <hut@lavabit.com>2009-12-23 19:53:42 +0100
commit793554498569c8f39e0ffcff4b475a948a4645c8 (patch)
treea5a35777655d7041a4b432446ac11136696d2615
parent9a78b6449cb256fbe46e05f5a134a6e512893450 (diff)
downloadranger-793554498569c8f39e0ffcff4b475a948a4645c8.tar.gz
improved loader performance with win.nodelay()
-rw-r--r--ranger/fsobject/loader.py6
-rw-r--r--ranger/gui/ui.py8
2 files changed, 7 insertions, 7 deletions
diff --git a/ranger/fsobject/loader.py b/ranger/fsobject/loader.py
index ef91aae3..00992651 100644
--- a/ranger/fsobject/loader.py
+++ b/ranger/fsobject/loader.py
@@ -11,10 +11,10 @@ def status_generator():
 		yield '|'
 
 def delayfunc(n):
-	if n < 4:
+#	if n < 4:
 		return 0.05
-	else:
-		return 0.3
+#	else:
+#		return 0.15
 #		return math.log(n-2) * 0.2
 
 class Loader(object):
diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py
index cdb58ad5..8134231e 100644
--- a/ranger/gui/ui.py
+++ b/ranger/gui/ui.py
@@ -67,16 +67,16 @@ class UI(DisplayableContainer):
 		curses.endwin()
 
 	def set_load_mode(self, boolean):
-		from ranger import log
 		boolean = bool(boolean)
 		if boolean != self.load_mode:
 			self.load_mode = boolean
 
 			if boolean:
-				log('setting halfdelay to 1')
-				curses.halfdelay(1)
+				# don't wait for key presses in the load mode
+				curses.cbreak()
+				self.win.nodelay(1)
 			else:
-				log('setting halfdelay to 20')
+				self.win.nodelay(0)
 				curses.halfdelay(20)
 
 	def destroy(self):
'#n182'>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 262