[Spambayes-checkins] spambayes/Outlook2000 config.py,1.4,1.5
Mark Hammond
mhammond at users.sourceforge.net
Fri Dec 13 01:27:14 EST 2002
Update of /cvsroot/spambayes/spambayes/Outlook2000
In directory sc8-pr-cvs1:/tmp/cvs-serv16704
Modified Files:
config.py
Log Message:
Prevent accidental setting of config options due to typos etc.
Index: config.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/config.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** config.py 7 Nov 2002 22:30:09 -0000 1.4
--- config.py 13 Dec 2002 09:27:12 -0000 1.5
***************
*** 14,17 ****
--- 14,21 ----
self.__dict__.update(kw)
+ def __setattr__(self, attr, val):
+ if not self.__dict__.has_key(attr):
+ raise AttributeError, attr
+ self.__dict__[attr] = val
# Crap state-loading code so when we load an early version of the pickle
# any attributes in the new version are considered defaults.
***************
*** 42,47 ****
class ConfigurationRoot(_ConfigurationContainer):
def __init__(self):
! _ConfigurationContainer.__init__(self)
! self.training = _ConfigurationContainer(
ham_folder_ids = [],
ham_include_sub = False,
--- 46,50 ----
class ConfigurationRoot(_ConfigurationContainer):
def __init__(self):
! training = _ConfigurationContainer(
ham_folder_ids = [],
ham_include_sub = False,
***************
*** 53,57 ****
train_manual_spam = True,
)
! self.filter = _ConfigurationContainer(
watch_folder_ids = [],
watch_include_sub = False,
--- 56,60 ----
train_manual_spam = True,
)
! filter = _ConfigurationContainer(
watch_folder_ids = [],
watch_include_sub = False,
***************
*** 64,68 ****
enabled = False,
)
! self.filter_now = _ConfigurationContainer(
folder_ids = [],
include_sub = False,
--- 67,71 ----
enabled = False,
)
! filter_now = _ConfigurationContainer(
folder_ids = [],
include_sub = False,
***************
*** 71,75 ****
action_all = True,
)
! self.field_score_name = "Spam"
if __name__=='__main__':
--- 74,83 ----
action_all = True,
)
! field_score_name = "Spam"
! _ConfigurationContainer.__init__(self,
! training=training,
! filter=filter,
! filter_now = filter_now,
! field_score_name = field_score_name)
if __name__=='__main__':
More information about the Spambayes-checkins
mailing list