|
@@ -67,6 +67,7 @@ def main():
|
|
|
const=True,
|
|
const=True,
|
|
|
default=False
|
|
default=False
|
|
|
)
|
|
)
|
|
|
|
|
+ dbparser.add_argument('-limit', type=int, dest='limit')
|
|
|
|
|
|
|
|
stations_parser = subparsers.add_parser('station')
|
|
stations_parser = subparsers.add_parser('station')
|
|
|
stations_parser.add_argument('action')
|
|
stations_parser.add_argument('action')
|
|
@@ -203,9 +204,14 @@ def main():
|
|
|
re_station = re.compile(r'^/var/fourier/[^/]+/([^/]+)')
|
|
re_station = re.compile(r'^/var/fourier/[^/]+/([^/]+)')
|
|
|
conn = sqlite3.connect(dbpath)
|
|
conn = sqlite3.connect(dbpath)
|
|
|
cursor = conn.cursor()
|
|
cursor = conn.cursor()
|
|
|
- cursor.execute(('select hash, filename '
|
|
|
|
|
- 'from file '
|
|
|
|
|
- 'where station is null'))
|
|
|
|
|
|
|
+ query = ('select hash, filename '
|
|
|
|
|
+ 'from file '
|
|
|
|
|
+ 'where station is null ')
|
|
|
|
|
+
|
|
|
|
|
+ if args.limit:
|
|
|
|
|
+ query += ' limit {}'.format(args.limit)
|
|
|
|
|
+
|
|
|
|
|
+ cursor.execute(query)
|
|
|
|
|
|
|
|
for row in cursor:
|
|
for row in cursor:
|
|
|
the_hash, filename, = row
|
|
the_hash, filename, = row
|