Fix both problems my previous commit had, and fix some indenting

issues in the code because of which LP URIs would not be recognized
when the 'full_uri' regex is used (iiuc).
This commit is contained in:
Siegfried-Angel Gevatter Pujals 2009-12-30 01:46:38 +01:00
parent 97edd822ef
commit 9d49e9ade3
1 changed files with 10 additions and 10 deletions

View File

@ -635,17 +635,17 @@ text/plain
self.matches['addr_only'] = self._vte.match_add (lboundry + "(www|ftp)[" + hostchars + "]*\.[" + hostchars + ".]+(:[0-9]+)?(" + urlpath + ")?" + rboundry + "/?")
self.matches['email'] = self._vte.match_add (lboundry + "(mailto:)?[a-zA-Z0-9][a-zA-Z0-9.+-]*@[a-zA-Z0-9][a-zA-Z0-9-]*\.[a-zA-Z0-9][a-zA-Z0-9-]+[.a-zA-Z0-9-]*" + rboundry)
self.matches['nntp'] = self._vte.match_add (lboundry + '''news:[-A-Z\^_a-z{|}~!"#$%&'()*+,./0-9;:=?`]+@[-A-Za-z0-9.]+(:[0-9]+)?''' + rboundry)
# if the url looks like a Launchpad changelog closure entry LP: #92953 - make it a url to http://bugs.launchpad.net
# the regular expression is similar to the perl one specified in the Ubuntu Policy Manual - /lp:\s+\#\d+(?:,\s*\#\d+)*/i
self.matches['launchpad-bug'] = self._vte.match_add ('\\b(lp|LP):?\s?#?[0-9]+(,\s*#?[0-9]+)*\\b')
# if it looks like a Launchpad Bazaar branch, make it a url too
lpfilters = {}
lpfilters['project'] = '[a-z0-9]{1}[a-z0-9\.\-\+]+'
lpfilters['group'] = '~%s' % lpfilters['project']
lpfilters['series'] = lpfilters['project']
lpfilters['branch'] = '[a-zA-Z0-9]{1}[a-zA-Z0-9\.\-\+_@]+'
self.matches['launchpad-branch'] = self._vte.match_add ('\\b(lp|LP):(%(project)s(/%(series)s)?|%(group)s/%(project)s/%(branch)s)\\b' % lpfilters)
self.matches['apturl'] = self._vte.match_add ('\\bapt.*\\b')
# if the url looks like a Launchpad changelog closure entry LP: #92953 - make it a url to http://bugs.launchpad.net
# the regular expression is similar to the perl one specified in the Ubuntu Policy Manual - /lp:\s+\#\d+(?:,\s*\#\d+)*/i
self.matches['launchpad-bug'] = self._vte.match_add ('\\b(lp|LP):?\s?#?[0-9]+(,\s*#?[0-9]+)*\\b')
# same for Bazaar branches hosted on Launchpad
lpfilters = {}
lpfilters['project'] = '[a-z0-9]{1}[a-z0-9\.\-\+]+'
lpfilters['group'] = '~%s' % lpfilters['project']
lpfilters['series'] = lpfilters['project']
lpfilters['branch'] = '[a-zA-Z0-9]{1}[a-zA-Z0-9_+@.-]+'
self.matches['launchpad-branch'] = self._vte.match_add ('\\b((lp|LP):%(project)s(/%(series)s)?|(lp|LP):%(group)s/%(project)s/%(branch)s)\\b' % lpfilters)
def _path_lookup(self, command):
if os.path.isabs (command):