Commits

Ronny Pfannschmidt committed 18a9a3c

cleanups

  • Participants
  • Parent commits ddd91e8

Comments (0)

Files changed (4)

     from glas_process.procdir import ProcDir
     from juggler.model import Task
 
-    task = Task(_id=nodeid,testcase=testname)
+    task = Task(_id=nodeid, testcase=testname)
     db.save_doc(task)
     procdir = ProcDir(db, tmpdir.join('proc'), task)
     if 'no_create' not in request._pyfuncitem.keywords:

File glas_process/baseproc.py

-from datetitme import datetime
+from datetime import datetime
 
 import gevent
 from gevent.queue import Queue

File glas_process/ddoc.py

 views = {
     'streams': {
         'map': """(doc) ->
-                log 'map streams', doc._id
                 if doc.doc_type == "juggler:Task"
                     emit [doc._id], null;
                 if doc.stream
                 return
         """,
         'reduce': """(key, values, rereduce) ->
-                log ['reduce streams', values, rereduce]
                 if rereduce
-                    items = [];
-                    while values.length
-                        items = items.concat values.pop()
+                    items = values.reduce Array.concat
                 else
                     items = values
-                log ['items', items]
                 unique = {};
-                while items.length
-                    entry = items.pop()
+                for entry in items
                     if entry != null
                         unique[entry] = true;
 
-                result = []
-                for key in unique
-                    result.push(key);
-                return result
+                key for key in unique
         """
     },
     'lines': {

File glas_process/procdir.py

 
         proc = lookup[doc.steper](self, doc)
 
-        return proc.wait()
+        return proc.run()
 
 
 def ProcBatch(object):