summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/core/helper.py45
-rw-r--r--ranger/defaults/options.py4
2 files changed, 16 insertions, 33 deletions
diff --git a/ranger/core/helper.py b/ranger/core/helper.py
index 45db80e9..eedbbb78 100644
--- a/ranger/core/helper.py
+++ b/ranger/core/helper.py
@@ -73,22 +73,24 @@ def load_settings(fm, clean):
 	from ranger.core.actions import Actions
 	import ranger.core.shared
 	import ranger.api.commands
+	from ranger.defaults import commands
+
+	# Load default commands
+	fm.commands = ranger.api.commands.CommandContainer()
+	exclude = ['settings']
+	include = [name for name in dir(Actions) if name not in exclude]
+	fm.commands.load_commands_from_object(fm, include)
+	fm.commands.load_commands_from_module(commands)
+
 	if not clean:
 		allow_access_to_confdir(ranger.arg.confdir, True)
 
-		# Load commands
-		comcont = ranger.api.commands.CommandContainer()
-		exclude = ['settings']
-		include = [name for name in dir(Actions) if name not in exclude]
-		comcont.load_commands_from_object(fm, include)
+		# Load custom commands
 		try:
 			import commands
-			comcont.load_commands_from_module(commands)
+			fm.commands.load_commands_from_module(commands)
 		except ImportError:
 			pass
-		from ranger.defaults import commands
-		comcont.load_commands_from_module(commands)
-		fm.commands = comcont
 
 		# Load apps
 		try:
@@ -102,24 +104,12 @@ def load_settings(fm, clean):
 		default_conf = fm.relpath('defaults', 'rc.conf')
 		load_default_rc = fm.settings.load_default_rc
 
-		# If load_default_rc is None, think hard:  If the users rc.conf is
-		# about as large as the default rc.conf, he probably copied it as a whole
-		# and doesn't want to load the default rc.conf anymore.
-		if load_default_rc is None:
-			try:
-				custom_conf_size = os.stat(custom_conf).st_size
-			except:
-				load_default_rc = True
-			else:
-				default_conf_size = os.stat(default_conf).st_size
-				load_default_rc = custom_conf_size < default_conf_size - 2048
-
 		if load_default_rc:
 			fm.source(default_conf)
 		if os.access(custom_conf, os.R_OK):
 			fm.source(custom_conf)
 
-		# Load plugins
+		# XXX Load plugins (experimental)
 		try:
 			plugindir = fm.confpath('plugins')
 			plugins = [p[:-3] for p in os.listdir(plugindir) \
@@ -145,16 +135,9 @@ def load_settings(fm, clean):
 
 		allow_access_to_confdir(ranger.arg.confdir, False)
 	else:
-		comcont = ranger.api.commands.CommandContainer()
-		from ranger.defaults import commands, apps
-		comcont = ranger.api.commands.CommandContainer()
-		exclude = ['settings']
-		include = [name for name in dir(Actions) if name not in exclude]
-		comcont.load_commands_from_object(fm, include)
-		comcont.load_commands_from_module(commands)
-		fm.commands = comcont
-		fm.source(fm.relpath('defaults', 'rc.conf'))
+		from ranger.defaults import apps
 		fm.apps = apps.CustomApplications()
+		fm.source(fm.relpath('defaults', 'rc.conf'))
 
 
 def load_apps(fm, clean):
diff --git a/ranger/defaults/options.py b/ranger/defaults/options.py
index d9f6278c..f4025a7c 100644
--- a/ranger/defaults/options.py
+++ b/ranger/defaults/options.py
@@ -34,8 +34,8 @@ of the values stay the same.
 from ranger.api.options import *
 
 # Load the deault rc.conf file?  If you've copied it to your configuration
-# direcory, then you should deactivate this option.  "None" means guess.
-load_default_rc = None
+# direcory, then you should deactivate this option.
+load_default_rc = True
 
 # How many columns are there, and what are their relative widths?
 column_ratios = (1, 3, 4)
/a> 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481