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
|
#!/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 anydbm
|
||||||
import getopt
|
import getopt
|
||||||
|
import operator
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@ -11,7 +12,7 @@ def usage():
|
||||||
print >>sys.stderr, "usage: dbtool {-a entry|-d entry|-l}"
|
print >>sys.stderr, "usage: dbtool {-a entry|-d entry|-l}"
|
||||||
|
|
||||||
try:
|
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:
|
except getopt.GetoptError, err:
|
||||||
print >>sys.stderr, str(err)
|
print >>sys.stderr, str(err)
|
||||||
usage()
|
usage()
|
||||||
|
@ -26,6 +27,9 @@ for (o, a) in optlist:
|
||||||
if o == "-l":
|
if o == "-l":
|
||||||
for i in sorted(downloaddb.keys()):
|
for i in sorted(downloaddb.keys()):
|
||||||
print "%s:\t%s" % (i, downloaddb[i])
|
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":
|
elif o == "-d":
|
||||||
del downloaddb[a]
|
del downloaddb[a]
|
||||||
elif o == "-a":
|
elif o == "-a":
|
||||||
|
|
Loading…
Reference in a new issue