Improvements to CLI/defaults.ini suggested by MrTyton.

This commit is contained in:
Jim Miller 2016-09-19 17:41:08 -05:00
parent fc477034e5
commit 860da1208e
2 changed files with 23 additions and 17 deletions

View file

@ -137,10 +137,6 @@ def main(argv=None,
options, args = parser.parse_args(argv)
# # XXX
# print options
# print args
if options.version:
print("Version: %s" % version)
return
@ -156,7 +152,7 @@ def main(argv=None,
))
if list_only and (args or any((options.downloadimap,
options.downloadlist))):
options.downloadlist))):
parser.error('Incorrect arguments: Cannot download and list URLs at the same time.')
if options.siteslist:
@ -174,6 +170,11 @@ def main(argv=None,
urls=args
if not list_only and not (args or any((options.downloadimap,
options.downloadlist))):
parser.print_help();
return
if options.list:
configuration = get_configuration(options.list,
passed_defaultsini,
@ -195,10 +196,6 @@ def main(argv=None,
retlist = get_urls_from_page(options.downloadlist, configuration)
urls.extend(retlist)
# l = filter(len, [x.strip() for x in retlist])
# if len(l) and options.downloadlist:
# urls.extend(l)
if options.imaplist or options.downloadimap:
# list doesn't have a supported site.
configuration = get_configuration('test1.com',passed_defaultsini,passed_personalini,options)
@ -227,7 +224,6 @@ def main(argv=None,
#print "URL: (%s)"%url
urls.append(url)
# print urls
if not list_only:
if len(urls) < 1:
print "No valid story URLs found"
@ -241,11 +237,6 @@ def main(argv=None,
#print("pagecache:%s"%options.pagecache.keys())
except Exception, e:
print "URL(%s) Failed: Exception (%s). Run URL individually for more detail."%(url,e)
# else:
# do_download(urls[0],
# options,
# passed_defaultsini,
# passed_personalini)
# make rest a function and loop on it.
def do_download(arg,

View file

@ -419,8 +419,23 @@ user_agent:FFF/2.X
#imap_username:youraddress@gmail.com
#imap_password:XXXXXXXX
#imap_folder:INBOX
## Mark mails with story URLs read or leave alone.
## Can be 'true', 'false' or 'downloadonly'.
## Mark mails with story URLs read:
## imap_mark_read can be 'true', 'false'(default) or 'downloadonly'.
##
## If 'true', unread emails will be marked as read when
## either CLI option --imap to list the story URLs or --download-imap
## to download story URLs from email are used.
##
## If 'downloadonly', unread emails will be marked as read
## only when CLI --download-imap to download story URLs from email are
## used.
##
## If 'false', unread emails will not be marked as read.
##
## Only unread emails will be searched for story URLs, and only emails
## containing valid story URLs will ever be marked read.
##
#imap_mark_read:true
[base_efiction]