mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
dd0dc01b7e
commit
20e46a53c6
@ -5,7 +5,7 @@ __license__ = 'GPL v3'
|
|||||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__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 subprocess import check_call
|
||||||
from tempfile import NamedTemporaryFile, mkdtemp
|
from tempfile import NamedTemporaryFile, mkdtemp
|
||||||
from zipfile import ZipFile
|
from zipfile import ZipFile
|
||||||
@ -64,15 +64,11 @@ class ReUpload(Command): # {{{
|
|||||||
|
|
||||||
# Data {{{
|
# Data {{{
|
||||||
def get_google_data():
|
def get_google_data():
|
||||||
PASSWORD_FILE = os.path.expanduser('~/.googlecodecalibre')
|
with open(os.path.expanduser('~/.googlecodecalibre'), 'rb') as f:
|
||||||
OFFLINEIMAP = os.path.expanduser('~/work/kde/conf/offlineimap/rc')
|
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 {
|
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_server':'root@kovidgoyal.net',
|
||||||
'path_map_location':'/var/www/status.calibre-ebook.com/googlepaths',
|
'path_map_location':'/var/www/status.calibre-ebook.com/googlepaths',
|
||||||
# If you change this remember to change it in the
|
# If you change this remember to change it in the
|
||||||
|
@ -69,11 +69,12 @@ def pdftohtml(output_dir, pdf_path, no_images):
|
|||||||
raise
|
raise
|
||||||
logf.flush()
|
logf.flush()
|
||||||
logf.close()
|
logf.close()
|
||||||
out = open(logf.name, 'rb').read()
|
out = open(logf.name, 'rb').read().strip()
|
||||||
if ret != 0:
|
if ret != 0:
|
||||||
raise ConversionError(out)
|
raise ConversionError(out)
|
||||||
print "pdftohtml log:"
|
if out:
|
||||||
print out
|
print "pdftohtml log:"
|
||||||
|
print out
|
||||||
if not os.path.exists(index) or os.stat(index).st_size < 100:
|
if not os.path.exists(index) or os.stat(index).st_size < 100:
|
||||||
raise DRMError()
|
raise DRMError()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user