Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

small improvements to planet, etc.

  • Loading branch information...
commit 31d6ba76d2e4602a77146b07a8f6a4c7734abe53 1 parent d0e0a9f
@fbreuer fbreuer authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 main.py
View
8 main.py
@@ -191,8 +191,8 @@ def fetch_entries(self):
for entry in feed['entries']:
try:
x = Entry()
- x.service = html_escape(self.title)
- x.title = html_escape(entry['title'])
+ x.service = HTML(self.title)
+ x.title = HTML(entry['title'])
x.link = html_escape(entry['link'])
x.length = len( get_feedparser_entry_content(entry) )
x.content = get_feedparser_entry_content(entry)
@@ -230,6 +230,8 @@ def comments_entries(self,num=None):
return result[0:num]
# fetching entries from comment feeds (just like regular feed)
def fetch_comments_entries(self):
+ if self.comments == "":
+ return []
try:
result = urlfetch.fetch(self.comments,deadline=10) # 10 is max deadline
except urlfetch.DownloadError:
@@ -401,7 +403,7 @@ def get(self):
class PlanetMath(webapp.RequestHandler):
def get(self):
all_entries = [ entry for feed in Feed.all() for entry in feed.entries() ]
- has_tag_math = lambda entry: len(filter(lambda tag: tag.term.lower() == "math", entry.tags)) > 0
+ has_tag_math = lambda entry: len(filter(lambda tag: tag.term.lower().find("math") == 0, entry.tags)) > 0
entries_tagged_math = filter(has_tag_math, all_entries)
entries_tagged_math.sort( lambda a,b: - cmp(a.timestamp,b.timestamp) )
template_values = { 'qf': QueryFactory(), 'mathentries': entries_tagged_math, 'menu': menu, 'footer': footer, 'disqus': disqus, 'header': header }
Please sign in to comment.
Something went wrong with that request. Please try again.