Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load system locale #32

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion planet.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
__license__ = "Python"


import os, sys
import os, sys, locale

if __name__ == "__main__":
locale.setlocale(locale.LC_ALL, '')
config_file = []
offline = 0
verbose = 0
Expand Down
7 changes: 5 additions & 2 deletions planet/shell/tmpl.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from xml.sax.saxutils import escape
import sgmllib, time, os, sys, new, urlparse, re
import sgmllib, time, os, sys, new, urlparse, re, locale
from planet import config, feedparser
import htmltmpl

Expand Down Expand Up @@ -62,7 +62,10 @@ def NewDate(value):
return time.strftime(config.new_date_format(), value)

def Rfc822(value):
return time.strftime("%a, %d %b %Y %H:%M:%S +0000", value)
locale.setlocale(locale.LC_ALL, "en_US.UTF-8")
nv = time.strftime("%a, %d %b %Y %H:%M:%S +0000", value)
locale.setlocale(locale.LC_ALL, "")
return nv

def Rfc3399(value):
return time.strftime("%Y-%m-%dT%H:%M:%S+00:00", value)
Expand Down
2 changes: 2 additions & 0 deletions planet/spider.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ def writeCache(feed_uri, feed_info, data):
else:
data.feed.links.append(feedparser.FeedParserDict(
{'rel':'self', 'type':feedtype, 'href':feed_uri}))
if not data.has_key('version'):
data.version = 'rss10'
for name, value in config.feed_options(feed_uri).items():
data.feed['planet_'+name] = value

Expand Down