From 6d7253853ca11320dd7d08720f8e7312c5fc5b2e Mon Sep 17 00:00:00 2001 From: hut Date: Thu, 11 Mar 2010 11:53:12 +0100 Subject: openstruct: faster implementation, removed ReferencedOpenStruct --- ranger/ext/openstruct.py | 25 +++++-------------------- ranger/gui/colorscheme.py | 1 - 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/ranger/ext/openstruct.py b/ranger/ext/openstruct.py index 56f7de06..11363127 100644 --- a/ranger/ext/openstruct.py +++ b/ranger/ext/openstruct.py @@ -13,23 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -class OpenStruct(object): - def __init__(self, __dictionary=None, **__keywords): - if __dictionary: - self.__dict__.update(__dictionary) - if __keywords: - self.__dict__.update(__keywords) - - def __getitem__(self, key): - return self.__dict__[key] - - def __setitem__(self, key, value): - self.__dict__[key] = value - return value - - def __contains__(self, key): - return key in self.__dict__ - -class ReferencedOpenStruct(OpenStruct): - def __init__(self, dictionary): - self.__dict__ = dictionary +class OpenStruct(dict): + """The fusion of dict and struct""" + def __init__(self, *args, **keywords): + dict.__init__(self, *args, **keywords) + self.__dict__ = self diff --git a/ranger/gui/colorscheme.py b/ranger/gui/colorscheme.py index 867aec70..99ea6ff7 100644 --- a/ranger/gui/colorscheme.py +++ b/ranger/gui/colorscheme.py @@ -41,7 +41,6 @@ If your colorscheme-file contains more than one colorscheme, specify it with: colorscheme = colorschemes.filename.classname """ -from ranger.ext.openstruct import ReferencedOpenStruct from curses import color_pair from ranger.gui.color import get_color from ranger.gui.context import Context -- cgit 1.4.1-2-gfad0 6ff5a92b1bc0fee1a1ddf946880f1697a35190'/>
path: root/TODO
blob: 0c89142b62246f3c916f57e909fba82c6d37ec61 (plain) (blame)
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