diff options
author | Abdó Roig-Maranges <abdo.roig@gmail.com> | 2012-12-06 15:12:54 +0100 |
---|---|---|
committer | hut <hut@lavabit.com> | 2012-12-09 15:16:45 +0100 |
commit | 864331a0edd73b364c22985bbb1aa7f55dcf25f4 (patch) | |
tree | 831b060f839eb11d34b17a58293b4220ff1800ff /ranger/fsobject/directory.py | |
parent | a45403b7f5c055ecac308c6b6adb1fe3f892f6eb (diff) | |
download | ranger-864331a0edd73b364c22985bbb1aa7f55dcf25f4.tar.gz |
Implement local per-directory settings
SettingObject can store settings local to a directory. Then LocalSettingObject choses the right settings according to context.
Diffstat (limited to 'ranger/fsobject/directory.py')
-rw-r--r-- | ranger/fsobject/directory.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ranger/fsobject/directory.py b/ranger/fsobject/directory.py index a58201c0..f8271b6d 100644 --- a/ranger/fsobject/directory.py +++ b/ranger/fsobject/directory.py @@ -3,6 +3,7 @@ import os.path import re + from os import stat as os_stat, lstat as os_lstat from collections import deque from time import time @@ -15,6 +16,7 @@ from ranger.core.shared import SettingsAware from ranger.ext.accumulator import Accumulator from ranger.ext.lazy_property import lazy_property from ranger.ext.human_readable import human_readable +from ranger.container.settingobject import LocalSettingObject def sort_by_basename(path): """returns path.basename (for sorting)""" @@ -99,6 +101,9 @@ class Directory(FileSystemObject, Accumulator, Loadable, SettingsAware): for opt in ('hidden_filter', 'show_hidden'): self.settings.signal_bind('setopt.' + opt, self.request_reload, weak=True, autosort=False) + + self.settings = LocalSettingObject(path, self.settings) + self.use() def request_resort(self): |