fixing blue title for RSS feeds
This commit is contained in:
parent
bf20721be5
commit
7781d7123c
27
offpunk.py
27
offpunk.py
|
@ -504,9 +504,10 @@ class FeedRenderer(AbstractRenderer):
|
||||||
t = parsed.feed.title
|
t = parsed.feed.title
|
||||||
else:
|
else:
|
||||||
t = "Unknown"
|
t = "Unknown"
|
||||||
title = "\x1b[1;4;34m%s (XML feed)\x1b[0m" %t
|
self.title = "%s (XML feed)" %t
|
||||||
self.title = textwrap.fill(title,width)
|
title = "\x1b[1;4;34m%s\x1b[0m" %self.title
|
||||||
page += self.title + "\n"
|
blue_title = textwrap.fill(title,width)
|
||||||
|
page += blue_title + "\n"
|
||||||
if "subtitle" in parsed.feed:
|
if "subtitle" in parsed.feed:
|
||||||
page += textwrap.fill(parsed.feed.subtitle,width) + "\n\n"
|
page += textwrap.fill(parsed.feed.subtitle,width) + "\n\n"
|
||||||
if "link" in parsed.feed:
|
if "link" in parsed.feed:
|
||||||
|
@ -870,23 +871,23 @@ class GeminiItem():
|
||||||
#else we fallback to hostname
|
#else we fallback to hostname
|
||||||
if self.scheme == "file":
|
if self.scheme == "file":
|
||||||
if self.name != "":
|
if self.name != "":
|
||||||
self.title = self.name
|
red_title = self.name
|
||||||
else:
|
else:
|
||||||
self.title = self.path
|
red_title = self.path
|
||||||
else:
|
else:
|
||||||
self.title = self.host
|
red_title = self.host
|
||||||
if "user" in self.path:
|
if "user" in self.path:
|
||||||
i = 0
|
i = 0
|
||||||
splitted = self.path.split("/")
|
splitted = self.path.split("/")
|
||||||
while i < (len(splitted)-1):
|
while i < (len(splitted)-1):
|
||||||
if splitted[i].startswith("user"):
|
if splitted[i].startswith("user"):
|
||||||
self.title = splitted[i+1]
|
red_title = splitted[i+1]
|
||||||
i += 1
|
i += 1
|
||||||
if "~" in self.path:
|
if "~" in self.path:
|
||||||
for pp in self.path.split("/"):
|
for pp in self.path.split("/"):
|
||||||
if pp.startswith("~"):
|
if pp.startswith("~"):
|
||||||
self.title = pp[1:]
|
red_title = pp[1:]
|
||||||
return self.title
|
return red_title
|
||||||
|
|
||||||
def is_cache_valid(self,validity=0):
|
def is_cache_valid(self,validity=0):
|
||||||
# Validity is the acceptable time for
|
# Validity is the acceptable time for
|
||||||
|
@ -2706,7 +2707,7 @@ archives, which is a special historical list limited in size. It is similar to `
|
||||||
if deleted:
|
if deleted:
|
||||||
print("Removed from %s"%li)
|
print("Removed from %s"%li)
|
||||||
self.list_add_top("archives",limit=self.options["archives_size"])
|
self.list_add_top("archives",limit=self.options["archives_size"])
|
||||||
print("%s added to your archives"%self.gi.full_title())
|
print("Archiving: %s"%self.gi.full_title())
|
||||||
print("\x1b[2;34mCurrent maximum size of archives : %s\x1b[0m" %self.options["archives_size"])
|
print("\x1b[2;34mCurrent maximum size of archives : %s\x1b[0m" %self.options["archives_size"])
|
||||||
|
|
||||||
def list_add_line(self,list,gi=None,verbose=True):
|
def list_add_line(self,list,gi=None,verbose=True):
|
||||||
|
@ -3188,6 +3189,9 @@ def main():
|
||||||
gc.sync_only = True
|
gc.sync_only = True
|
||||||
lists = gc.list_lists()
|
lists = gc.list_lists()
|
||||||
# We will fetch all the lists except "archives" and "history"
|
# We will fetch all the lists except "archives" and "history"
|
||||||
|
# We keep tour for the last round
|
||||||
|
if "tour" in lists:
|
||||||
|
lists.remove("tour")
|
||||||
if "archives" in lists:
|
if "archives" in lists:
|
||||||
lists.remove("archives")
|
lists.remove("archives")
|
||||||
if "history" in lists:
|
if "history" in lists:
|
||||||
|
@ -3203,6 +3207,9 @@ def main():
|
||||||
#then we fetch all the rest (including bookmarks and tour)
|
#then we fetch all the rest (including bookmarks and tour)
|
||||||
for l in lists:
|
for l in lists:
|
||||||
fetch_list(l,validity=refresh_time,depth=depth)
|
fetch_list(l,validity=refresh_time,depth=depth)
|
||||||
|
#tour should be the last one as item my be added to it by others
|
||||||
|
fetch_list("tour",validity=refresh_time,depth=depth)
|
||||||
|
|
||||||
|
|
||||||
gc.onecmd("blackbox")
|
gc.onecmd("blackbox")
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue