mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
4a39461ebc
commit
553ae3f8ac
@ -408,6 +408,8 @@ def cli_parser():
|
|||||||
epilog=epilog)
|
epilog=epilog)
|
||||||
sf = subparsers.add_parser('sourceforge', help='Upload to sourceforge',
|
sf = subparsers.add_parser('sourceforge', help='Upload to sourceforge',
|
||||||
epilog=epilog)
|
epilog=epilog)
|
||||||
|
cron = subparsers.add_parser('cron', help='Call script from cron')
|
||||||
|
|
||||||
a = gc.add_argument
|
a = gc.add_argument
|
||||||
|
|
||||||
a('project',
|
a('project',
|
||||||
@ -433,12 +435,19 @@ def cli_parser():
|
|||||||
a('username',
|
a('username',
|
||||||
help='Sourceforge username')
|
help='Sourceforge username')
|
||||||
|
|
||||||
|
a = cron.add_argument
|
||||||
|
a('username',
|
||||||
|
help='Username to log into your google account')
|
||||||
|
a('password',
|
||||||
|
help='Password to log into your google account')
|
||||||
|
|
||||||
return p
|
return p
|
||||||
|
|
||||||
def main(args=None):
|
def main(args=None):
|
||||||
cli = cli_parser()
|
cli = cli_parser()
|
||||||
args = cli.parse_args(args)
|
args = cli.parse_args(args)
|
||||||
files = {}
|
files = {}
|
||||||
|
if args.service != 'cron':
|
||||||
with args.file_map as f:
|
with args.file_map as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
fname, _, desc = line.partition(':')
|
fname, _, desc = line.partition(':')
|
||||||
@ -460,6 +469,8 @@ def main(args=None):
|
|||||||
sf = SourceForge(ofiles, args.project, args.version, args.username,
|
sf = SourceForge(ofiles, args.project, args.version, args.username,
|
||||||
replace=args.replace)
|
replace=args.replace)
|
||||||
sf()
|
sf()
|
||||||
|
elif args.service == 'cron':
|
||||||
|
login_to_google(args.username, args.password)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user