From bea392eb2b3a4cc1a05e49a336deae94897eb455 Mon Sep 17 00:00:00 2001 From: MrTyton Date: Tue, 6 Sep 2016 23:57:23 -0400 Subject: [PATCH] Fixed formatting of subprocess --- fanficdownload-cleaned.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fanficdownload-cleaned.py b/fanficdownload-cleaned.py index f406c45..3801933 100644 --- a/fanficdownload-cleaned.py +++ b/fanficdownload-cleaned.py @@ -41,12 +41,12 @@ def main(user, password, server="imap.gmail.com", label="INBOX", path=""): for url in urls: print "Working with url {}".format(url) 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 print "\tStory is in calibre with id {}".format(id) try: 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(".") for cur in onlyfiles: 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) 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 "\tAdding {} to library".format(cur) - 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 add "{}" {}'.format(cur, 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 res remove(cur) @@ -90,7 +90,7 @@ def main(user, password, server="imap.gmail.com", label="INBOX", path=""): if not cur.endswith(".epub"): continue try: 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 remove(cur) except Exception: