[Spambayes-checkins] spambayes pop3graph.py,1.2,1.3

Skip Montanaro montanaro at users.sourceforge.net
Tue Jan 14 09:11:12 EST 2003


Update of /cvsroot/spambayes/spambayes
In directory sc8-pr-cvs1:/tmp/cvs-serv21813

Modified Files:
	pop3graph.py 
Log Message:
add #! line and grok -h/--help flags


Index: pop3graph.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/pop3graph.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** pop3graph.py	14 Jan 2003 05:38:19 -0000	1.2
--- pop3graph.py	14 Jan 2003 17:10:57 -0000	1.3
***************
*** 1,2 ****
--- 1,4 ----
+ #!/usr/bin/env python
+ 
  """Analyse the pop3proxy's caches and produce a graph of how accurate
  classifier has been over time.  Only really meaningful if you started
***************
*** 6,14 ****
  
  import sys
  from spambayes import  mboxutils
  from spambayes.FileCorpus import FileCorpus, FileMessageFactory, GzipFileMessageFactory
  from spambayes.Options import options
  
! def main():
     # Create the corpuses and the factory that reads the messages.
     if options.pop3proxy_cache_use_gzip:
--- 8,27 ----
  
  import sys
+ import getopt
+ 
  from spambayes import  mboxutils
  from spambayes.FileCorpus import FileCorpus, FileMessageFactory, GzipFileMessageFactory
  from spambayes.Options import options
  
! def usage():
!    print __doc__
! 
! def main(argv):
!    opts, args = getopt.getopt(argv, "h", ["help"])
!    for opt, arg in opts:
!       if opt in ("-h", "--help"):
!          usage()
!          return
! 
     # Create the corpuses and the factory that reads the messages.
     if options.pop3proxy_cache_use_gzip:
***************
*** 73,75 ****
  
  if __name__ == '__main__':
!    main()
--- 86,88 ----
  
  if __name__ == '__main__':
!    main(sys.argv[1:])





More information about the Spambayes-checkins mailing list