changeset 5727:17bcec43f773

googleimport: remove pointless if clause, rearrange some code
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 20 Nov 2010 19:45:48 +0100
parents e7914bd67889
children bbfe34d68e6c
files contrib/googleimport/driver.py
diffstat 1 files changed, 3 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/googleimport/driver.py	Sat Nov 20 19:21:41 2010 +0100
+++ b/contrib/googleimport/driver.py	Sat Nov 20 19:45:48 2010 +0100
@@ -108,7 +108,6 @@
                 raise Exception("Desc not found")
             desc = desc_m.groups()[0]
 
-
             for i in range(1, count + 1):
                 text = desc
                 new_summary = summary
@@ -159,17 +158,14 @@
 
 
 def pull_and_gencsv():
-    csvwriter = csv.writer(sys.stdout, delimiter=",", doublequote=True)
-    summary_prefix = "[TEST] " # EMPTY FOR PRODUCTION IMPORT!
-    if summary_prefix:
-        tmin, tmax = 0, None
-    else:
-        tmin, tmax = 0, None
     print >> sys.stderr, "Collecting tasks ..."
     tasks = Collector("http://moinmo.in/").collect_tasks()
     print >> sys.stderr, "Importing %i tasks ..." % (len(tasks), )
     print >> sys.stderr, "\n".join(repr(task) for task in tasks)
 
+    summary_prefix = '' # "[TEST] " # EMPTY FOR PRODUCTION IMPORT!
+    tmin, tmax = 0, None
+    csvwriter = csv.writer(sys.stdout, delimiter=",", doublequote=True)
     for task in tasks[tmin:tmax]:
         csvwriter.writerow([summary_prefix + task.summary, task.desc, task.hours, task.mentors, task.difficulty, task.types, task.label])