diff --git a/setup/upload.py b/setup/upload.py index d07a26b4d7..ffeb248b91 100644 --- a/setup/upload.py +++ b/setup/upload.py @@ -5,7 +5,7 @@ __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal ' __docformat__ = 'restructuredtext en' -import os, re, subprocess, hashlib, shutil, glob, stat, sys, time +import os, subprocess, hashlib, shutil, glob, stat, sys, time from subprocess import check_call from tempfile import NamedTemporaryFile, mkdtemp from zipfile import ZipFile @@ -64,15 +64,11 @@ class ReUpload(Command): # {{{ # Data {{{ def get_google_data(): - PASSWORD_FILE = os.path.expanduser('~/.googlecodecalibre') - OFFLINEIMAP = os.path.expanduser('~/work/kde/conf/offlineimap/rc') + with open(os.path.expanduser('~/.googlecodecalibre'), 'rb') as f: + gc_password, ga_un, pw = f.read().strip().split('|') - gc_password = open(PASSWORD_FILE).read().strip() - raw = open(OFFLINEIMAP).read() - pw = re.search(r'(?s)remoteuser = .*@gmail.com.*?remotepass = (\S+)', - raw).group(1).strip() return { - 'username':'kovidgoyal@gmail.com', 'password':pw, 'gc_password':gc_password, + 'username':ga_un, 'password':pw, 'gc_password':gc_password, 'path_map_server':'root@kovidgoyal.net', 'path_map_location':'/var/www/status.calibre-ebook.com/googlepaths', # If you change this remember to change it in the diff --git a/src/calibre/ebooks/pdf/pdftohtml.py b/src/calibre/ebooks/pdf/pdftohtml.py index 9d81c73c2a..dbb3e5d2c2 100644 --- a/src/calibre/ebooks/pdf/pdftohtml.py +++ b/src/calibre/ebooks/pdf/pdftohtml.py @@ -69,11 +69,12 @@ def pdftohtml(output_dir, pdf_path, no_images): raise logf.flush() logf.close() - out = open(logf.name, 'rb').read() + out = open(logf.name, 'rb').read().strip() if ret != 0: raise ConversionError(out) - print "pdftohtml log:" - print out + if out: + print "pdftohtml log:" + print out if not os.path.exists(index) or os.stat(index).st_size < 100: raise DRMError()