Nach Datum sortiert ausgeben dazu
This commit is contained in:
parent
500219a4af
commit
e54350c0c6
1 changed files with 6 additions and 2 deletions
|
@ -1,9 +1,10 @@
|
|||
#!/usr/local/bin/python
|
||||
|
||||
# $Schlepperbande: src/tivomirror/dbtool,v 1.2 2010/12/18 09:11:46 stb Exp $
|
||||
# $Schlepperbande: src/tivomirror/dbtool,v 1.3 2010/12/18 10:03:31 stb Exp $
|
||||
|
||||
import anydbm
|
||||
import getopt
|
||||
import operator
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
@ -11,7 +12,7 @@ def usage():
|
|||
print >>sys.stderr, "usage: dbtool {-a entry|-d entry|-l}"
|
||||
|
||||
try:
|
||||
optlist, args = getopt.getopt(sys.argv[1:], "a:d:l")
|
||||
optlist, args = getopt.getopt(sys.argv[1:], "a:d:lk")
|
||||
except getopt.GetoptError, err:
|
||||
print >>sys.stderr, str(err)
|
||||
usage()
|
||||
|
@ -26,6 +27,9 @@ for (o, a) in optlist:
|
|||
if o == "-l":
|
||||
for i in sorted(downloaddb.keys()):
|
||||
print "%s:\t%s" % (i, downloaddb[i])
|
||||
elif o == "-k":
|
||||
for (k, v) in sorted(downloaddb.items(), key=operator.itemgetter(1)):
|
||||
print "%s:\t%s" % (k, v)
|
||||
elif o == "-d":
|
||||
del downloaddb[a]
|
||||
elif o == "-a":
|
||||
|
|
Loading…
Reference in a new issue