Fixed formatting of subprocess
This commit is contained in:
parent
69bc997073
commit
bea392eb2b
@ -41,12 +41,12 @@ def main(user, password, server="imap.gmail.com", label="INBOX", path=""):
|
|||||||
for url in urls:
|
for url in urls:
|
||||||
print "Working with url {}".format(url)
|
print "Working with url {}".format(url)
|
||||||
try:
|
try:
|
||||||
res = subprocess.check_output('calibredb search "Identifiers:{}"'.format(url, path), shell=True,stderr=subprocess.STDOUT)
|
res = subprocess.check_output('calibredb search "Identifiers:{}" {}'.format(url, path), shell=True,stderr=subprocess.STDOUT)
|
||||||
id = res
|
id = res
|
||||||
print "\tStory is in calibre with id {}".format(id)
|
print "\tStory is in calibre with id {}".format(id)
|
||||||
try:
|
try:
|
||||||
print "\tExporting file"
|
print "\tExporting file"
|
||||||
res = subprocess.check_output('calibredb export {} --dont-save-cover --dont-write-opf --single-dir'.format(id, path), shell=True)
|
res = subprocess.check_output('calibredb export {} --dont-save-cover --dont-write-opf --single-dir {}'.format(id, path), shell=True)
|
||||||
onlyfiles = files(".")
|
onlyfiles = files(".")
|
||||||
for cur in onlyfiles:
|
for cur in onlyfiles:
|
||||||
if not cur.endswith(".epub"): continue
|
if not cur.endswith(".epub"): continue
|
||||||
@ -67,11 +67,11 @@ def main(user, password, server="imap.gmail.com", label="INBOX", path=""):
|
|||||||
res = subprocess.check_output('fanficfare -u "{}" --force --update-cover'.format(cur), shell=True,stderr=subprocess.STDOUT)
|
res = subprocess.check_output('fanficfare -u "{}" --force --update-cover'.format(cur), shell=True,stderr=subprocess.STDOUT)
|
||||||
|
|
||||||
print "\tRemoving {} from library".format(id)
|
print "\tRemoving {} from library".format(id)
|
||||||
res = subprocess.check_output('calibredb remove {}'.format(id, path), shell=True,stderr=subprocess.STDOUT)
|
res = subprocess.check_output('calibredb remove {} {}'.format(id, path), shell=True,stderr=subprocess.STDOUT)
|
||||||
#print res
|
#print res
|
||||||
print "\tAdding {} to library".format(cur)
|
print "\tAdding {} to library".format(cur)
|
||||||
res = subprocess.check_output('calibredb add "{}"'.format(cur, path), shell=True,stderr=subprocess.STDOUT)
|
res = subprocess.check_output('calibredb add "{}" {}'.format(cur, path), shell=True,stderr=subprocess.STDOUT)
|
||||||
res = subprocess.check_output('calibredb search "Identifiers:{}"'.format(url, path), shell=True, stderr=subprocess.STDOUT)
|
res = subprocess.check_output('calibredb search "Identifiers:{}" {}'.format(url, path), shell=True, stderr=subprocess.STDOUT)
|
||||||
print "\tAdded {} to library with id {}".format(cur, res)
|
print "\tAdded {} to library with id {}".format(cur, res)
|
||||||
#print res
|
#print res
|
||||||
remove(cur)
|
remove(cur)
|
||||||
@ -90,7 +90,7 @@ def main(user, password, server="imap.gmail.com", label="INBOX", path=""):
|
|||||||
if not cur.endswith(".epub"): continue
|
if not cur.endswith(".epub"): continue
|
||||||
try:
|
try:
|
||||||
print "\tAdding {} to library".format(cur)
|
print "\tAdding {} to library".format(cur)
|
||||||
res = subprocess.check_output('calibredb add "{}"'.format(cur, path), shell=True, stderr=subprocess.STDOUT)
|
res = subprocess.check_output('calibredb add "{}" {}'.format(cur, path), shell=True, stderr=subprocess.STDOUT)
|
||||||
#print res
|
#print res
|
||||||
remove(cur)
|
remove(cur)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
Loading…
Reference in New Issue
Block a user