output.write('%d files (out of %d) were not found at "%s"\n'% \
(len(bad),len(r),args.directory))
output.write('%d files (out of %d) were not found at "%s"\n'%
(len(bad),len(r),args.directory))
return0
defadd_command(subparsers):
"""Add specific subcommands that the action "checkfiles" can use"""
...
...
@@ -60,7 +62,7 @@ def add_command(subparsers):
db=Database()
ifnotdb.is_valid():
protocols=('waiting','for','database','creation')
protocols=('waiting','for','database','creation')
clients=tuple()
else:
protocols=[k.nameforkindb.protocols()]
...
...
@@ -75,6 +77,6 @@ def add_command(subparsers):
parser.add_argument('-l','--light',dest="light",default='',help="if given, this value will limit the check to those files shot under a given lighting. (defaults to '%(default)s')",choices=db.lights())
parser.add_argument('-C','--client',dest="client",default=None,type=int,help="if given, limits the dump to a particular client (defaults to '%(default)s')",choices=clients)
parser.add_argument('path',nargs='+',type=str,help="one or more path stems to look up. If you provide more than one, files which cannot be reversed will be omitted from the output.")
"""Adds the specific options for the path command"""
...
...
@@ -68,9 +75,10 @@ def path_command(subparsers):
parser.add_argument('-e','--extension',dest="extension",default='',help="if given, this extension will be appended to every entry returned (defaults to '%(default)s')")
parser.add_argument('id',nargs='+',type=int,help="one or more file ids to look up. If you provide more than one, files which cannot be found will be omitted from the output. If you provide a single id to lookup, an error message will be printed if the id does not exist in the database. The exit status will be non-zero in such case.")
"""Add specific subcommands that the action "dumplist" can use"""
...
...
@@ -47,7 +48,7 @@ def add_command(subparsers):
db=Database()
ifnotdb.is_valid():
protocols=('waiting','for','database','creation')
protocols=('waiting','for','database','creation')
clients=tuple()
else:
protocols=[k.nameforkindb.protocols()]
...
...
@@ -63,6 +64,6 @@ def add_command(subparsers):
parser.add_argument('-l','--light',dest="light",default='',help="if given, this value will limit the output files to those shot under a given lighting. (defaults to '%(default)s')",choices=db.lights())
parser.add_argument('-C','--client',dest="client",default=None,type=int,help="if given, limits the dump to a particular client (defaults to '%(default)s')",choices=clients)