summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/ext/openstruct.py25
-rw-r--r--ranger/gui/colorscheme.py1
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 <http://www.gnu.org/licenses/>.
 
-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