Commits

Ronny Pfannschmidt  committed 909ac05

simplerows helper

  • Participants
  • Parent commits 29b45d8

Comments (0)

Files changed (2)

File filetrack/analyze.py

-from .utils import appcommand
+from .utils import appcommand, simplerows
 
 
 REPOS = '''
 
 @appcommand
 def repos(db, type_):
-    results = db.execute(REPOS, {'type': '.' + type_})
-    for item in results:
-        print(item[0])
+    simplerows(db, REPOS, {'type': '.' + type_})

File filetrack/utils.py

         with closing(db):
             func(db, *args)
     return command
+
+
+def simplerows(db, query, args):
+    for row in db.execute(query, args):
+        print(row[0])
+