mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Upload installers to downloadbestsoftware.com as well
This commit is contained in:
parent
f58b8aee4f
commit
d2292a759d
@ -402,6 +402,29 @@ def upload_to_servers(files, version): # {{{
|
||||
print ('Uploaded in', int(time.time() - start), 'seconds\n\n')
|
||||
# }}}
|
||||
|
||||
def upload_to_dbs(files, version): # {{{
|
||||
print('Uploading to downloadbestsoftware.com')
|
||||
server = 'www.downloadbestsoft-mirror1.com'
|
||||
rdir = 'release/'
|
||||
check_call(['ssh', 'kovid@%s' % server, 'rm -f release/*'])
|
||||
for x in files:
|
||||
start = time.time()
|
||||
print ('Uploading', x)
|
||||
for i in range(5):
|
||||
try:
|
||||
check_call(['rsync', '-h', '-z', '--progress', '-e', 'ssh -x', x,
|
||||
'kovid@%s:%s'%(server, rdir)])
|
||||
except KeyboardInterrupt:
|
||||
raise SystemExit(1)
|
||||
except:
|
||||
print ('\nUpload failed, trying again in 30 seconds')
|
||||
time.sleep(30)
|
||||
else:
|
||||
break
|
||||
print ('Uploaded in', int(time.time() - start), 'seconds\n\n')
|
||||
check_call(['ssh', 'kovid@%s' % server, '/home/kovid/uploadFiles'])
|
||||
# }}}
|
||||
|
||||
# CLI {{{
|
||||
def cli_parser():
|
||||
epilog='Copyright Kovid Goyal 2012'
|
||||
@ -434,6 +457,7 @@ def cli_parser():
|
||||
epilog=epilog)
|
||||
cron = subparsers.add_parser('cron', help='Call script from cron')
|
||||
subparsers.add_parser('calibre', help='Upload to calibre file servers')
|
||||
subparsers.add_parser('dbs', help='Upload to downloadbestsoftware.com')
|
||||
|
||||
a = gc.add_argument
|
||||
|
||||
@ -498,6 +522,8 @@ def main(args=None):
|
||||
login_to_google(args.username, args.password)
|
||||
elif args.service == 'calibre':
|
||||
upload_to_servers(ofiles, args.version)
|
||||
elif args.service == 'dbs':
|
||||
upload_to_dbs(ofiles, args.version)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
@ -114,6 +114,9 @@ def sf_cmdline(ver, sdata):
|
||||
def calibre_cmdline(ver):
|
||||
return [__appname__, ver, 'fmap', 'calibre']
|
||||
|
||||
def dbs_cmdline(ver):
|
||||
return [__appname__, ver, 'fmap', 'dbs']
|
||||
|
||||
def run_remote_upload(args):
|
||||
print 'Running remotely:', ' '.join(args)
|
||||
subprocess.check_call(['ssh', '-x', '%s@%s'%(STAGING_USER, STAGING_HOST),
|
||||
@ -140,6 +143,7 @@ class UploadInstallers(Command): # {{{
|
||||
self.upload_to_staging(tdir, backup, files)
|
||||
self.upload_to_sourceforge()
|
||||
self.upload_to_calibre()
|
||||
self.upload_to_dbs()
|
||||
# self.upload_to_google(opts.replace)
|
||||
finally:
|
||||
shutil.rmtree(tdir, ignore_errors=True)
|
||||
@ -184,6 +188,8 @@ class UploadInstallers(Command): # {{{
|
||||
def upload_to_calibre(self):
|
||||
run_remote_upload(calibre_cmdline(__version__))
|
||||
|
||||
def upload_to_dbs(self):
|
||||
run_remote_upload(dbs_cmdline(__version__))
|
||||
# }}}
|
||||
|
||||
class UploadUserManual(Command): # {{{
|
||||
|
Loading…
x
Reference in New Issue
Block a user