summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/index.py b/index.py
index 1161165..5a37008 100644
--- a/index.py
+++ b/index.py
@@ -26,7 +26,8 @@ filepaths = Queue()
documents = Queue()
notifier = Condition()
-directory = unicode(sys.argv[0], "utf8")
+directory = unicode(sys.argv[1], "utf8")
+print u"Walking {0}".format(directory)
filecount = 0
for path, directories, files in os.walk(directory):
for filename in files:
@@ -54,6 +55,7 @@ class PDFWorker(Thread):
except Exception, e:
print u"{0} Exception: {1}".format(self.name, str(e))
finally:
+ print u"{0} finished {1}".format(self.name, filepath)
filepaths.task_done()
class IndexWorker(Thread):
@@ -66,10 +68,10 @@ class IndexWorker(Thread):
writer = index.writer()
writer.add_document(**doc)
documents.task_done()
- print u"Added {0}".format(doc['path'])
+ print u"{0} added {1}".format(self.name, doc['path'])
writer.commit()
-threads = map(lambda i: PDFWorker(), range(4))
+threads = map(lambda i: PDFWorker(), range(1))
for thread in threads:
thread.start()
@@ -108,4 +110,3 @@ oldindex.close()
except Exception,e:
print e
"""
-index.close()