frozen api

This commit is contained in:
gwen 2012-09-18 16:14:47 +02:00
parent 99dc71a752
commit f50935523f
1 changed files with 4 additions and 1 deletions

View File

@ -157,6 +157,9 @@ class Option(HiddenBaseType, DisabledBaseType):
def is_forced_on_freeze(self): def is_forced_on_freeze(self):
return self._frozen and self._force_default_on_freeze return self._frozen and self._force_default_on_freeze
def is_frozen(self):
return self._frozen
def getdoc(self): def getdoc(self):
return self.doc return self.doc
@ -176,7 +179,7 @@ class Option(HiddenBaseType, DisabledBaseType):
# config *must* be only the **parent** config (not the toplevel config) # config *must* be only the **parent** config (not the toplevel config)
# owner is a **real* owner, a list is actually allowable here # owner is a **real* owner, a list is actually allowable here
name = self._name name = self._name
if self._frozen: if self.is_frozen() and config.is_frozen():
raise TypeError("trying to change a frozen option's owner: %s" % name) raise TypeError("trying to change a frozen option's owner: %s" % name)
if self.is_multi(): if self.is_multi():
if not type(owner) == list: if not type(owner) == list: