comparison src/pages/common/blog/page_meta.py @ 1038:6b906b1f419a

pages: fixed XMPP URIs handling
author Goffi <goffi@goffi.org>
date Wed, 24 Jan 2018 09:57:57 +0100
parents f5661761b1b9
children 6bc7768faa5d
comparison
equal deleted inserted replaced
1037:dc6c8c4d8ff6 1038:6b906b1f419a
8 from sat.core.i18n import _ 8 from sat.core.i18n import _
9 from sat.core.log import getLogger 9 from sat.core.log import getLogger
10 from sat.tools.common.template import safe 10 from sat.tools.common.template import safe
11 from server import utils 11 from server import utils
12 import re 12 import re
13 import urllib
14 import cgi 13 import cgi
15 log = getLogger('pages/common/blog') 14 log = getLogger('pages/common/blog')
16 15
17 """generic blog (with service/node provided)""" 16 """generic blog (with service/node provided)"""
18 name = u'blog' 17 name = u'blog'
21 20
22 RE_TEXT_URL = re.compile(ur'[^a-zA-Zéèêôà,_]+') 21 RE_TEXT_URL = re.compile(ur'[^a-zA-Zéèêôà,_]+')
23 TEXT_MAX_LEN = 60 22 TEXT_MAX_LEN = 60
24 23
25 def microblog_uri(self, uri_data): 24 def microblog_uri(self, uri_data):
26 service = urllib.quote_plus(uri_data[u'path']) 25 args = [uri_data[u'path'], uri_data[u'node']]
27 node = urllib.quote_plus(uri_data[u'node']) 26 if u'item' in uri_data:
28 return service + u'/' + node 27 args.extend([u'id', uri_data[u'item']])
29 28 return self.getURL(*args)
30 29
31 def parse_url(self, request): 30 def parse_url(self, request):
32 """URL is /[service]/[node]/[filter_keyword]/[item]|[other] 31 """URL is /[service]/[node]/[filter_keyword]/[item]|[other]
33 32
34 if [node] is '@', default namespace is used 33 if [node] is '@', default namespace is used