diff --git a/manual/resources/simple_donate_button.gif b/manual/resources/simple_donate_button.gif new file mode 100644 index 0000000000..42dd2c3c88 Binary files /dev/null and b/manual/resources/simple_donate_button.gif differ diff --git a/manual/templates/layout.html b/manual/templates/layout.html index b8389b0ac9..188e829469 100644 --- a/manual/templates/layout.html +++ b/manual/templates/layout.html @@ -62,7 +62,7 @@
- +

diff --git a/setup/hosting.py b/setup/hosting.py index 9853f181a4..76ab3992a0 100644 --- a/setup/hosting.py +++ b/setup/hosting.py @@ -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() diff --git a/setup/upload.py b/setup/upload.py index 784c0cf9f8..8a4e467dd0 100644 --- a/setup/upload.py +++ b/setup/upload.py @@ -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): # {{{ diff --git a/src/calibre/ebooks/lrf/html/convert_from.py b/src/calibre/ebooks/lrf/html/convert_from.py index c755cabd92..2b9a3617dc 100644 --- a/src/calibre/ebooks/lrf/html/convert_from.py +++ b/src/calibre/ebooks/lrf/html/convert_from.py @@ -104,7 +104,7 @@ class HTMLConverter(object): # Replace entities (re.compile(ur'&(\S+?);'), partial(entity_to_unicode, - exceptions=['lt', 'gt', 'amp'])), + exceptions=['lt', 'gt', 'amp', 'quot'])), # Remove comments from within style tags as they can mess up BeatifulSoup (re.compile(r'()', re.IGNORECASE|re.DOTALL), strip_style_comments),