Author: rgardler
Date: Thu Nov 18 21:48:22 2010
New Revision: 1036647

URL: http://svn.apache.org/viewvc?rev=1036647&view=rev
Log:
Story history.dat alongside all other data

Modified:
    labs/agora/src/python/process.py

Modified: labs/agora/src/python/process.py
URL: 
http://svn.apache.org/viewvc/labs/agora/src/python/process.py?rev=1036647&r1=1036646&r2=1036647&view=diff
==============================================================================
--- labs/agora/src/python/process.py (original)
+++ labs/agora/src/python/process.py Thu Nov 18 21:48:22 2010
@@ -51,6 +51,7 @@ program = sys.argv[0]
 loud = True
 force = False
 list = None
+datadir = "data"
 
 #-----------------------------------------------------------------------# 
 
@@ -68,8 +69,9 @@ def clear_running(piddir):
 #-----------------------------------------------------------------------# 
 
 def load_history():
-    if os.path.exists("history.dat"):
-        f = open("history.dat","r")
+    global datadir
+    if os.path.exists(os.path.join(datadir,"history.dat")):
+        f = open(os.path.join(datadir,"history.dat"),"r")
         history = pickle.load(f)
         f.close()
     else:
@@ -77,7 +79,8 @@ def load_history():
     return history
     
 def save_history(history):
-    f = open("history.dat","w")
+    global datadir
+    f = open(os.path.join(datadir,"history.dat"),"w")
     pickle.dump(history,f)
     f.close()
 
@@ -214,6 +217,8 @@ def crawl(history,archives,input_path,ou
         if file: 
             archives.write("-:\n")
     else:
+        if list is not None and list in file:
+            print "Ignorning file", input
         if loud:
           print "Process file", input
         m = mbox_pattern.match(file)
@@ -251,7 +256,7 @@ def usage(code, msg=''):
 def main():
     """ Main program; parse options and go. """
 
-    global loud, force, list
+    global loud, force, list, datadir
 
     try:
         opts, args = getopt.getopt(sys.argv[1:], 'hsfqvd:m:p:l:')
@@ -259,7 +264,6 @@ def main():
         usage(2, msg)
 
     maildir = "mail"
-    datadir = "data"
     piddir = "."
 
     for opt, arg in opts:



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to