[Spambayes-checkins]
spambayes/Outlook2000 addin.py,1.6,1.7 config.py,1.1,1.2
filter.py,1.6,1.7 manager.py,1.12,1.13 rule.py,1.3,1.4
Tim Peters
tim_one@users.sourceforge.net
Sun, 20 Oct 2002 11:53:08 -0700
Update of /cvsroot/spambayes/spambayes/Outlook2000
In directory usw-pr-cvs1:/tmp/cvs-serv8818
Modified Files:
addin.py config.py filter.py manager.py rule.py
Log Message:
Whitespace normalization.
Index: addin.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** addin.py 20 Oct 2002 18:49:53 -0000 1.6
--- addin.py 20 Oct 2002 18:53:06 -0000 1.7
***************
*** 65,87 ****
# Something that should be in win32com in some form or another.
def CastTo(ob, target):
! """'Cast' a COM object to another type"""
! if hasattr(target, "index"): # string like
# for now, we assume makepy for this to work.
! if not ob.__class__.__dict__.get("CLSID"): # Eeek - no makepy support - try and build it.
! ob = gencache.EnsureDispatch(ob)
! if not ob.__class__.__dict__.get("CLSID"):
! raise ValueError, "Must be a makepy-able object for this to work"
! clsid = ob.CLSID
! mod = gencache.GetModuleForCLSID(clsid)
! # Get the 'root' module.
! mod = gencache.GetModuleForTypelib(mod.CLSID, mod.LCID, mod.MajorVersion, mod.MinorVersion)
! # Find the CLSID of the target
! # XXX - should not be looking in VTables..., but no general map currently exists
! target_clsid = mod.VTablesNamesToIIDMap.get(target)
! mod = gencache.GetModuleForCLSID(target_clsid)
! target_class = getattr(mod, target)
! # resolve coclass to interface
! target_class = getattr(target_class, "default_interface", target_class)
! return target_class(ob) # auto QI magic happens
# Whew - we seem to have all the COM support we need - let's rock!
--- 65,87 ----
# Something that should be in win32com in some form or another.
def CastTo(ob, target):
! """'Cast' a COM object to another type"""
! if hasattr(target, "index"): # string like
# for now, we assume makepy for this to work.
! if not ob.__class__.__dict__.get("CLSID"): # Eeek - no makepy support - try and build it.
! ob = gencache.EnsureDispatch(ob)
! if not ob.__class__.__dict__.get("CLSID"):
! raise ValueError, "Must be a makepy-able object for this to work"
! clsid = ob.CLSID
! mod = gencache.GetModuleForCLSID(clsid)
! # Get the 'root' module.
! mod = gencache.GetModuleForTypelib(mod.CLSID, mod.LCID, mod.MajorVersion, mod.MinorVersion)
! # Find the CLSID of the target
! # XXX - should not be looking in VTables..., but no general map currently exists
! target_clsid = mod.VTablesNamesToIIDMap.get(target)
! mod = gencache.GetModuleForCLSID(target_clsid)
! target_class = getattr(mod, target)
! # resolve coclass to interface
! target_class = getattr(target_class, "default_interface", target_class)
! return target_class(ob) # auto QI magic happens
# Whew - we seem to have all the COM support we need - let's rock!
Index: config.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/config.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** config.py 20 Oct 2002 07:47:00 -0000 1.1
--- config.py 20 Oct 2002 18:53:06 -0000 1.2
***************
*** 33,37 ****
else:
d(name, level+1)
!
class ConfigurationRoot(_ConfigurationContainer):
def __init__(self):
--- 33,37 ----
else:
d(name, level+1)
!
class ConfigurationRoot(_ConfigurationContainer):
def __init__(self):
Index: filter.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/filter.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** filter.py 20 Oct 2002 12:20:52 -0000 1.6
--- filter.py 20 Oct 2002 18:53:06 -0000 1.7
***************
*** 44,48 ****
if filter_message(message, mgr):
num_messages += 1
!
return num_messages
--- 44,48 ----
if filter_message(message, mgr):
num_messages += 1
!
return num_messages
Index: manager.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/manager.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** manager.py 20 Oct 2002 12:20:52 -0000 1.12
--- manager.py 20 Oct 2002 18:53:06 -0000 1.13
***************
*** 222,226 ****
d = dialogs.TrainingDialog.TrainingDialog(dlg.mgr, train.trainer)
d.DoModal()
!
def do_classify(dlg):
import classify
--- 222,226 ----
d = dialogs.TrainingDialog.TrainingDialog(dlg.mgr, train.trainer)
d.DoModal()
!
def do_classify(dlg):
import classify
***************
*** 236,240 ****
if dlg.mgr.addin is not None:
dlg.mgr.addin.FiltersChanged()
!
import dialogs.ManagerDialog
d = dialogs.ManagerDialog.ManagerDialog(mgr, do_train, do_filter, do_classify)
--- 236,240 ----
if dlg.mgr.addin is not None:
dlg.mgr.addin.FiltersChanged()
!
import dialogs.ManagerDialog
d = dialogs.ManagerDialog.ManagerDialog(mgr, do_train, do_filter, do_classify)
***************
*** 255,259 ****
print "Usage: manager [-v ...]"
sys.exit(1)
!
if __name__=='__main__':
verbose = 1
--- 255,259 ----
print "Usage: manager [-v ...]"
sys.exit(1)
!
if __name__=='__main__':
verbose = 1
Index: rule.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/rule.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** rule.py 20 Oct 2002 07:47:00 -0000 1.3
--- rule.py 20 Oct 2002 18:53:06 -0000 1.4
***************
*** 60,69 ****
outlook_message.FlagStatus = constants.olFlagMarked
dirty = True
! if self.write_field:
format = 4 # 4=2 decimal, 3=1 decimal - index in "field chooser" combo when type=Number.
prop = outlook_message.UserProperties.Add(self.write_field_name, constants.olNumber, True, format)
prop.Value = prob
dirty = True
! if dirty:
outlook_message.Save()
--- 60,69 ----
outlook_message.FlagStatus = constants.olFlagMarked
dirty = True
! if self.write_field:
format = 4 # 4=2 decimal, 3=1 decimal - index in "field chooser" combo when type=Number.
prop = outlook_message.UserProperties.Add(self.write_field_name, constants.olNumber, True, format)
prop.Value = prob
dirty = True
! if dirty:
outlook_message.Save()