Fix for (past)contrib author in tthfanficorg. Tweak meaning of --force in CLI.

This commit is contained in:
Jim Miller
2011-12-15 16:48:24 -06:00
parent 63faea59d8
commit 33b15fe7c1
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -70,7 +70,7 @@ def main():
help="Update an existing epub with new chapter, give epub filename instead of storyurl. Not compatible with inserted TOC.",)
parser.add_option("--force",
action="store_true", dest="force",
help="Force update of an existing epub, download and overwrite all chapters.",)
help="Force overwrite or update of an existing epub, download and overwrite all chapters.",)
(options, args) = parser.parse_args()
@@ -102,6 +102,10 @@ def main():
config.add_section("overrides")
except ConfigParser.DuplicateSectionError:
pass
if options.force:
config.set("overrides","always_overwrite","true")
if options.options:
for opt in options.options:
(var,val) = opt.split('=')
@@ -98,7 +98,7 @@ class TwistingTheHellmouthSiteAdapter(BaseSiteAdapter):
a = soup.find('a', href=re.compile(r"^/AuthorStories-\d+"))
self.story.setMetadata('authorId',a['href'].split('/')[1].split('-')[1])
self.story.setMetadata('authorUrl','http://'+self.host+a['href'])
self.story.setMetadata('author',a.string)
self.story.setMetadata('author',stripHTML(a))
try:
# going to pull part of the meta data from author list page.