Permalink
Browse files

ranger.main: no file previews when user == root

  • Loading branch information...
1 parent 6df94b8 commit 414b01ecfc75d2c977b52c93ab4045f959246914 @hut hut committed Sep 13, 2010
Showing with 5 additions and 1 deletion.
  1. +2 −0 ranger/__main__.py
  2. +3 −1 ranger/shared/settings.py
View
@@ -212,6 +212,8 @@ def print_function(string):
fm.tabs = dict((n+1, os.path.abspath(path)) for n, path \
in enumerate(targets[:9]))
load_settings(fm, ranger.arg.clean)
+ if fm.env.username == 'root':
+ fm.settings.preview_files = False
FileManagerAware._assign(fm)
fm.ui = UI()
@@ -66,7 +66,9 @@ def __setattr__(self, name, value):
if name[0] == '_':
self.__dict__[name] = value
else:
- assert name in self._settings, "No such setting: {0}!".format(name)
+ assert name in ALLOWED_SETTINGS, "No such setting: {0}!".format(name)
+ if name not in self._settings:
+ getattr(self, name)
assert self._check_type(name, value)
kws = dict(setting=name, value=value,
previous=self._settings[name])

0 comments on commit 414b01e

Please sign in to comment.