Fix include once always staying on, only turn it on until a include says to turn it back off, if one of those is encountered

This commit is contained in:
Joshua Harlow 2012-06-18 17:29:16 -07:00
parent 8e43f12b1b
commit d5ba0f66d7
1 changed files with 6 additions and 3 deletions

View File

@ -100,7 +100,7 @@ class UserDataProcessor(object):
'urlcache', entry_fn)
def _do_include(self, content, append_msg):
# Inlude a list of urls, one per line
# Include a list of urls, one per line
# also support '#include <url here>'
# or #include-once '<url here>'
include_once_on = False
@ -109,11 +109,14 @@ class UserDataProcessor(object):
if lc_line.startswith("#include-once"):
line = line[len("#include-once"):].lstrip()
# Every following include will now
# not be refetched....
# not be refetched.... but will be
# re-read from a local urlcache (if it worked)
include_once_on = True
elif lc_line.startswith("#include"):
line = line[len("#include"):].lstrip()
# TODO: Should we turn back off include once here???
# Disable the include once if it was on
# if it wasn't, then this has no effect.
include_once_on = False
if line.startswith("#"):
continue
include_url = line.strip()