Compare commits

..

No commits in common. "5044b2b0e9eab7e6d0e75ceff100fa825be19108" and "fb55d1bd49efc5721ee5df8b720c6f406da7e818" have entirely different histories.

3 changed files with 9 additions and 10 deletions

View File

@ -1,3 +1,4 @@
import os, argparse import os, argparse
from tomlkit import loads from tomlkit import loads
from tomlkit import dump from tomlkit import dump
@ -33,7 +34,7 @@ class MicroblogConfig:
def check(self, r, u): # (reference, user) def check(self, r, u): # (reference, user)
for key in r: for key in r:
if key == "latestpages": continue if key == "latestpages": continue;
# post and webring have subtables # post and webring have subtables
# webring.profile # webring.profile
# webring.following # webring.following

View File

@ -550,9 +550,6 @@ if __name__ == "__main__":
updated += writepage(tpl, tl, tc, cfg["page"], updated += writepage(tpl, tl, tc, cfg["page"],
paginate=True if new_posts is None else False) paginate=True if new_posts is None else False)
if cfg["rss"]["enabled"]: if cfg["rss"]["enabled"]:
# ensure output directory for feeds exists
if not os.path.exists("feeds"):
os.mkdir("feeds")
feed_filename = "feeds/__index__.xml" feed_filename = "feeds/__index__.xml"
rss.write_feed( rss.write_feed(
p[:cfg["rss"]["limit"]], \ p[:cfg["rss"]["limit"]], \

View File

@ -1,3 +1,4 @@
from microblog import My_Html_Parser from microblog import My_Html_Parser
# from html.parser import HTMLParser # from html.parser import HTMLParser
from html import escape from html import escape
@ -6,7 +7,7 @@ try:
import feedgenerator import feedgenerator
except ImportError: except ImportError:
traceback.print_exc() traceback.print_exc()
def write_feed(posts, filename, params, tagname=None): def write_feed(posts, filename, params):
pass pass
print("\trss disabled - missing dependency", file=sys.stderr) print("\trss disabled - missing dependency", file=sys.stderr)
print("\tYour microblog still may have been generated.", file=sys.stderr) print("\tYour microblog still may have been generated.", file=sys.stderr)
@ -21,7 +22,7 @@ def line2words(lines, limit):
l = len(word) l = len(word)
if limit > 0 and (l + char_count > limit): if limit > 0 and (l + char_count > limit):
break_outer_loop = True break_outer_loop = True
break break;
output.append(word) output.append(word)
char_count += l char_count += l
if break_outer_loop: if break_outer_loop:
@ -34,10 +35,10 @@ def line2words(lines, limit):
output.append("...") output.append("...")
return output return output
# this is similar to the markup function in microblog # this is similar tot he markup function in microblog
def enrich_msg(lines, is_atom=True): def enrich_msg(lines, is_atom=True):
if not is_atom: if not is_atom:
return lines return string
content = [] content = []
parser = My_Html_Parser([]) parser = My_Html_Parser([])
for line in lines: for line in lines:
@ -65,9 +66,9 @@ def enrich_msg(lines, is_atom=True):
content.append(line) content.append(line)
return content return content
def write_feed(posts, filename, params, tagname=None): def write_feed(posts, filename, params, tagname=str()):
feed = None feed = None
if tagname: if tagname != str():
t = params["title_tagged"].format( t = params["title_tagged"].format(
__tagname__ = tagname, __tagname__ = tagname,
__title__ = params["title"]) __title__ = params["title"])