summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2012-08-05 01:10:28 +0200
committerhut <hut@lavabit.com>2012-08-05 14:36:32 +0200
commit708498b97ba9b576cba304e0d07de63e48b833e3 (patch)
treef8c9c0eb75ec8cf84ff302a0ae229bc9d5e3d528
parent9fb987c29b60414588226eac24d307bfe8b7a938 (diff)
downloadranger-708498b97ba9b576cba304e0d07de63e48b833e3.tar.gz
core.environment: s/fm.env.directories/fm.directories
-rw-r--r--ranger/core/environment.py18
-rw-r--r--ranger/core/fm.py1
2 files changed, 9 insertions, 10 deletions
diff --git a/ranger/core/environment.py b/ranger/core/environment.py
index 153e4f55..affef49b 100644
--- a/ranger/core/environment.py
+++ b/ranger/core/environment.py
@@ -10,9 +10,9 @@ from ranger.fsobject import Directory
 from ranger.ext.keybinding_parser import KeyBuffer, KeyMaps
 from ranger.container.history import History
 from ranger.ext.signals import SignalDispatcher
-from ranger.core.shared import SettingsAware
+from ranger.core.shared import SettingsAware, FileManagerAware
 
-class Environment(SettingsAware, SignalDispatcher):
+class Environment(SettingsAware, FileManagerAware, SignalDispatcher):
 	"""
 	A collection of data which is relevant for more than one class.
 	"""
@@ -22,7 +22,6 @@ class Environment(SettingsAware, SignalDispatcher):
 	cmd = None
 	cut = None
 	history = None
-	directories = None
 	last_search = None
 	pathway = None
 	path = None
@@ -32,7 +31,6 @@ class Environment(SettingsAware, SignalDispatcher):
 		self.path = abspath(expanduser(path))
 		self._cf = None
 		self.pathway = ()
-		self.directories = {}
 		self.keybuffer = KeyBuffer()
 		self.keymaps = KeyMaps(self.keybuffer)
 		self.copy = set()
@@ -83,7 +81,7 @@ class Environment(SettingsAware, SignalDispatcher):
 				else:
 					return None
 			try:
-				return self.directories[directory.path]
+				return self.fm.directories[directory.path]
 			except AttributeError:
 				return None
 			except KeyError:
@@ -91,14 +89,14 @@ class Environment(SettingsAware, SignalDispatcher):
 
 	def garbage_collect(self, age, tabs):
 		"""Delete unused directory objects"""
-		for key in tuple(self.directories):
-			value = self.directories[key]
+		for key in tuple(self.fm.directories):
+			value = self.fm.directories[key]
 			if age != -1:
 				if not value.is_older_than(age) or value in self.pathway:
 					continue
 				if value in tabs.values():
 					continue
-			del self.directories[key]
+			del self.fm.directories[key]
 			if value.is_directory:
 				value.files = None
 		self.settings.signal_garbage_collect()
@@ -113,10 +111,10 @@ class Environment(SettingsAware, SignalDispatcher):
 		"""Get the directory object at the given path"""
 		path = abspath(path)
 		try:
-			return self.directories[path]
+			return self.fm.directories[path]
 		except KeyError:
 			obj = Directory(path)
-			self.directories[path] = obj
+			self.fm.directories[path] = obj
 			return obj
 
 	def get_free_space(self, path):
diff --git a/ranger/core/fm.py b/ranger/core/fm.py
index 3264196f..161818b9 100644
--- a/ranger/core/fm.py
+++ b/ranger/core/fm.py
@@ -41,6 +41,7 @@ class FM(Actions, SignalDispatcher):
 		Actions.__init__(self)
 		SignalDispatcher.__init__(self)
 		self.ui = ui
+		self.directories = dict()
 		self.log = deque(maxlen=20)
 		self.bookmarks = bookmarks
 		self.tags = tags
committer Drew DeVault <sir@cmpwn.com> 2019-05-16 14:16:45 -0400 Improve reply-all recipient enumeration strategy' href='/akspecs/aerc/commit/commands/account/reply.go?h=0.1.4&id=ce0d0e887ccf386006a5f1a425d9aa971190c610'>ce0d0e8 ^
8be59ca ^
475b697 ^





















8be59ca ^








475b697 ^
ce0d0e8 ^












475b697 ^

7f97e0b ^





475b697 ^



ca2cd00 ^


475b697 ^



8be59ca ^










475b697 ^
8be59ca ^
511fea3 ^

5701b6e ^



















8be59ca ^
5701b6e ^
8be59ca ^





ca2cd00 ^
8be59ca ^







475b697 ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
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