From 2fb6b9b329c38bfe17051b85da4f17587f83095a Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Fri, 6 Mar 2009 11:25:15 +0000 Subject: [PATCH] be more careful about static class properties --- terminatorlib/config.py | 17 ++++++++++++----- terminatorlib/terminator.py | 3 ++- terminatorlib/terminatorterm.py | 3 ++- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/terminatorlib/config.py b/terminatorlib/config.py index 3a090c4c..eff6103d 100755 --- a/terminatorlib/config.py +++ b/terminatorlib/config.py @@ -159,10 +159,12 @@ Defaults = { class TerminatorConfig: """This class is used as the base point of the config system""" callback = None - sources = [] + sources = None + _keys = None def __init__ (self, sources): - self._keys = None + self.sources = [] + for source in sources: if isinstance(source, TerminatorConfValuestore): self.sources.append (source) @@ -201,9 +203,12 @@ class TerminatorConfig: class TerminatorConfValuestore: type = "Base" - values = {} + values = None reconfigure_callback = None + def __init__ (self): + self._values = {} + # Our settings def __getitem__ (self, keyname): if self.values.has_key (keyname): @@ -349,12 +354,14 @@ Errors were encountered while parsing terminator_config(5) file: class TerminatorConfValuestoreGConf (TerminatorConfValuestore): profile = "" client = None - cache = {} - notifies = {} + cache = None + notifies = None def __init__ (self, profileName = None): self.type = "GConf" self.inactive = False + self.cache = {} + self.notifies = {} import gconf diff --git a/terminatorlib/terminator.py b/terminatorlib/terminator.py index 9afbf323..49f06d78 100755 --- a/terminatorlib/terminator.py +++ b/terminatorlib/terminator.py @@ -127,7 +127,7 @@ class TerminatorNotebookTabLabel(gtk.HBox): class Terminator: options = None - groupings = [] + groupings = None def __init__ (self, profile = None, command = None, fullscreen = False, maximise = False, borderless = False, no_gconf = False, @@ -145,6 +145,7 @@ class Terminator: self.term_list = [] self.gnome_client = None stores = [] + self.groupings = [] store = config.TerminatorConfValuestoreRC () store.set_reconfigure_callback (self.reconfigure_vtes) diff --git a/terminatorlib/terminatorterm.py b/terminatorlib/terminatorterm.py index 66a70930..2aa5e9f3 100755 --- a/terminatorlib/terminatorterm.py +++ b/terminatorlib/terminatorterm.py @@ -136,7 +136,7 @@ class TerminatorTermTitle (gtk.EventBox): class TerminatorTerm (gtk.VBox): - matches = {} + matches = None TARGET_TYPE_VTE = 8 _custom_font_size = None _group = None @@ -148,6 +148,7 @@ class TerminatorTerm (gtk.VBox): self.conf = terminator.conf self.command = command self._oldtitle = "" + self.matches = {} self.cwd = cwd or os.getcwd(); if not os.path.exists(self.cwd) or not os.path.isdir(self.cwd):