Merge branch 'master' into pylons0.10
* master: updated translations add support for non-url information
This commit is contained in:
commit
f2e90118f6
8 changed files with 102 additions and 39 deletions
|
@ -21,7 +21,7 @@
|
|||
[DEFAULT]
|
||||
keyring.dir=${HOME}/debian/keyring.debian.org/keyrings
|
||||
urlbuilder.sections=overview,bugs,build,qa,upload,lists,files,membership,
|
||||
miscellaneous,ubuntu
|
||||
miscellaneous,ssh,ubuntu
|
||||
|
||||
[overview]
|
||||
urls=ddpo,alladdresses
|
||||
|
@ -86,17 +86,19 @@ debtags.pattern=http://debtags.alioth.debian.org/todo.html?maint=%(email)s
|
|||
links.pattern=http://www.google.com/search?hl=en&lr=&q=site%%3Adebian.org+%%22%(name)s%%22+-site%%3Anm.debian.org+-site%%3Alintian.debian.org+-site%%3Abugs.debian.org+-site%%3Alists.debian.org+-site%%3Apackages.debian.org+-site%%3Alists.alioth.debian.org+-site%%3Aftp.debian.org++-site%%3Apackages.qa.debian.org++-site%%3Aftp*.*.debian.org+-inurl%%3Adebian.org%%2Fdevel%%2Fpeople.+-inurl%%3Aindices%%2FMaintainers+-inurl%%3Adebian.org%%2Fdebian%%2Fproject++-inurl%%3A%%2Fdists%%2F&btnG=Search
|
||||
website.pattern=http://www.google.com/search?q=site:www.debian.org+%(name)s
|
||||
search.pattern=http://search.debian.org/?q=%%22%(name)s%%22
|
||||
|
||||
[ssh]
|
||||
# SSH functions
|
||||
#
|
||||
urls=owndndoms,miainfo,groupinfo
|
||||
# owned *.debian.net domains
|
||||
# ssh merkel.debian.org ldapsearch -u -x -H ldap://db.debian.org -b dc=debian,dc=org \
|
||||
# uid=%(username)s dnsZoneEntry
|
||||
#
|
||||
owndndoms.pattern=ssh merkel.debian.org ldapsearch -u -x -H ldap://db.debian.org -b dc=debian,dc=org uid=%(username)s dnsZoneEntry
|
||||
owndndoms.type=ssh
|
||||
# MIA information
|
||||
# ssh merkel.debian.org /srv/qa.debian.org/mia/mia-query %(username)s
|
||||
#
|
||||
miainfo.pattern=ssh merkel.debian.org /srv/qa.debian.org/mia/mia-query %(username)s
|
||||
miainfo.type=ssh
|
||||
# Group information
|
||||
# ssh merkel.debian.org id %(username)s
|
||||
groupinfo.pattern=ssh merkel.debian.org id %(username)s
|
||||
groupinfo.type=ssh
|
||||
|
||||
[ubuntu]
|
||||
urls=ubuntudiff
|
||||
|
|
|
@ -46,6 +46,17 @@ _FIELDNAMES_MAP = {
|
|||
}
|
||||
|
||||
|
||||
class DDPortfolioEntry(object):
|
||||
def __init__(self, config, section, key):
|
||||
self.name = key
|
||||
self.optional = config.has_option(section, key + '.optional') and \
|
||||
config.getboolean(section, key + '.optional') or False
|
||||
if config.has_option(section, key + '.type'):
|
||||
self.type = config.get(section, key + '.type')
|
||||
else:
|
||||
self.type = 'url'
|
||||
|
||||
|
||||
def build_urls(fields):
|
||||
"""Build personalized URLs using the developer information in
|
||||
fields."""
|
||||
|
@ -70,22 +81,20 @@ def build_urls(fields):
|
|||
'urlbuilder.sections').split(',')]:
|
||||
data.append(['section', section])
|
||||
if my_config.has_option(section, 'urls'):
|
||||
for url in my_config.get(section, 'urls').split(','):
|
||||
if my_config.has_option(section, url + '.pattern'):
|
||||
optional = my_config.has_option(section, url + '.optional') \
|
||||
and my_config.getboolean(section, url + '.optional') or False
|
||||
try:
|
||||
data.append(
|
||||
['url', section, url,
|
||||
my_config.get(section, url + '.pattern',
|
||||
for entry in ([DDPortfolioEntry(my_config, section, url) for url in \
|
||||
my_config.get(section, 'urls').split(',')]):
|
||||
try:
|
||||
data.append(
|
||||
['url', section, entry,
|
||||
my_config.get(section, entry.name + '.pattern',
|
||||
False, qfields)])
|
||||
except InterpolationMissingOptionError, e:
|
||||
if not optional:
|
||||
if e.reference in _FIELDNAMES_MAP:
|
||||
data.append(['error', section, url,
|
||||
_('Missing input: %s') % \
|
||||
_(_FIELDNAMES_MAP[e.reference])])
|
||||
else:
|
||||
data.append(['error', section, url,
|
||||
_('Missing input: %s') % e.reference])
|
||||
except InterpolationMissingOptionError, e:
|
||||
if not entry.optional:
|
||||
if e.reference in _FIELDNAMES_MAP:
|
||||
data.append(['error', section, entry,
|
||||
_('Missing input: %s') % \
|
||||
_(_FIELDNAMES_MAP[e.reference])])
|
||||
else:
|
||||
data.append(['error', section, entry,
|
||||
_('Missing input: %s') % e.reference])
|
||||
return data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue