Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updated atomformat to 0.1.1dev

  • Loading branch information...
commit 850cb34115c23dbd4e6e59442993eee0ad1fb0a3 1 parent 6b02bb2
@brosner brosner authored
Showing with 9 additions and 4 deletions.
  1. +9 −4 notification/atomformat.py
View
13 notification/atomformat.py
@@ -61,11 +61,16 @@ def rfc3339_date(date):
## based on django.utils.feedgenerator.get_tag_uri
def get_tag_uri(url, date):
"Creates a TagURI. See http://diveintomark.org/archives/2004/05/28/howto-atom-id"
- tag = re.sub('^http://', '', url)
+ parts = urlparse.urlparse(url)
+ date_part = ""
if date is not None:
- tag = re.sub('/', ',%s:/' % date.strftime('%Y-%m-%d'), tag, 1)
- tag = re.sub('#', '/', tag)
- return 'tag:' + tag
+ date_part = ",%s:" % date.strftime("%Y-%m-%d")
+ return "tag:%s%s%s/%s" % (
+ parts.hostname,
+ date_part,
+ parts.path,
+ parts.fragment,
+ )
Please sign in to comment.
Something went wrong with that request. Please try again.