be more careful about static class properties

This commit is contained in:
Chris Jones 2009-03-06 11:25:15 +00:00
parent 5e46e1a967
commit 2fb6b9b329
3 changed files with 16 additions and 7 deletions

View File

@ -159,10 +159,12 @@ Defaults = {
class TerminatorConfig: class TerminatorConfig:
"""This class is used as the base point of the config system""" """This class is used as the base point of the config system"""
callback = None callback = None
sources = [] sources = None
_keys = None
def __init__ (self, sources): def __init__ (self, sources):
self._keys = None self.sources = []
for source in sources: for source in sources:
if isinstance(source, TerminatorConfValuestore): if isinstance(source, TerminatorConfValuestore):
self.sources.append (source) self.sources.append (source)
@ -201,9 +203,12 @@ class TerminatorConfig:
class TerminatorConfValuestore: class TerminatorConfValuestore:
type = "Base" type = "Base"
values = {} values = None
reconfigure_callback = None reconfigure_callback = None
def __init__ (self):
self._values = {}
# Our settings # Our settings
def __getitem__ (self, keyname): def __getitem__ (self, keyname):
if self.values.has_key (keyname): if self.values.has_key (keyname):
@ -349,12 +354,14 @@ Errors were encountered while parsing terminator_config(5) file:
class TerminatorConfValuestoreGConf (TerminatorConfValuestore): class TerminatorConfValuestoreGConf (TerminatorConfValuestore):
profile = "" profile = ""
client = None client = None
cache = {} cache = None
notifies = {} notifies = None
def __init__ (self, profileName = None): def __init__ (self, profileName = None):
self.type = "GConf" self.type = "GConf"
self.inactive = False self.inactive = False
self.cache = {}
self.notifies = {}
import gconf import gconf

View File

@ -127,7 +127,7 @@ class TerminatorNotebookTabLabel(gtk.HBox):
class Terminator: class Terminator:
options = None options = None
groupings = [] groupings = None
def __init__ (self, profile = None, command = None, fullscreen = False, def __init__ (self, profile = None, command = None, fullscreen = False,
maximise = False, borderless = False, no_gconf = False, maximise = False, borderless = False, no_gconf = False,
@ -145,6 +145,7 @@ class Terminator:
self.term_list = [] self.term_list = []
self.gnome_client = None self.gnome_client = None
stores = [] stores = []
self.groupings = []
store = config.TerminatorConfValuestoreRC () store = config.TerminatorConfValuestoreRC ()
store.set_reconfigure_callback (self.reconfigure_vtes) store.set_reconfigure_callback (self.reconfigure_vtes)

View File

@ -136,7 +136,7 @@ class TerminatorTermTitle (gtk.EventBox):
class TerminatorTerm (gtk.VBox): class TerminatorTerm (gtk.VBox):
matches = {} matches = None
TARGET_TYPE_VTE = 8 TARGET_TYPE_VTE = 8
_custom_font_size = None _custom_font_size = None
_group = None _group = None
@ -148,6 +148,7 @@ class TerminatorTerm (gtk.VBox):
self.conf = terminator.conf self.conf = terminator.conf
self.command = command self.command = command
self._oldtitle = "" self._oldtitle = ""
self.matches = {}
self.cwd = cwd or os.getcwd(); self.cwd = cwd or os.getcwd();
if not os.path.exists(self.cwd) or not os.path.isdir(self.cwd): if not os.path.exists(self.cwd) or not os.path.isdir(self.cwd):