PEP-8 compliance
- fix all PEP-8 warnings - bump copyright years
This commit is contained in:
parent
e643987d3d
commit
6224abdf63
16 changed files with 164 additions and 128 deletions
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# DDPortfolio service environment configuration
|
# DDPortfolio service environment configuration
|
||||||
# Copyright © 2009, 2010 Jan Dittberner <jan@dittberner.info>
|
# Copyright © 2009, 2010, 2011, 2012 Jan Dittberner <jan@dittberner.info>
|
||||||
#
|
#
|
||||||
# This file is part of DDPortfolio service.
|
# This file is part of DDPortfolio service.
|
||||||
#
|
#
|
||||||
|
@ -31,9 +31,10 @@ import ddportfolioservice.lib.app_globals as app_globals
|
||||||
import ddportfolioservice.lib.helpers
|
import ddportfolioservice.lib.helpers
|
||||||
from ddportfolioservice.config.routing import make_map
|
from ddportfolioservice.config.routing import make_map
|
||||||
|
|
||||||
|
|
||||||
def load_environment(global_conf, app_conf):
|
def load_environment(global_conf, app_conf):
|
||||||
"""Configure the Pylons environment via the ``pylons.config``
|
"""
|
||||||
object
|
Configure the Pylons environment via the ``pylons.config`` object
|
||||||
"""
|
"""
|
||||||
config = PylonsConfig()
|
config = PylonsConfig()
|
||||||
|
|
||||||
|
@ -45,7 +46,8 @@ def load_environment(global_conf, app_conf):
|
||||||
templates=[os.path.join(root, 'templates')])
|
templates=[os.path.join(root, 'templates')])
|
||||||
|
|
||||||
# Initialize config with the basic options
|
# Initialize config with the basic options
|
||||||
config.init_app(global_conf, app_conf, package='ddportfolioservice', paths=paths)
|
config.init_app(
|
||||||
|
global_conf, app_conf, package='ddportfolioservice', paths=paths)
|
||||||
|
|
||||||
config['routes.map'] = make_map(config)
|
config['routes.map'] = make_map(config)
|
||||||
config['pylons.app_globals'] = app_globals.Globals(config)
|
config['pylons.app_globals'] = app_globals.Globals(config)
|
||||||
|
@ -55,7 +57,6 @@ def load_environment(global_conf, app_conf):
|
||||||
import pylons
|
import pylons
|
||||||
pylons.cache._push_object(config['pylons.app_globals'].cache)
|
pylons.cache._push_object(config['pylons.app_globals'].cache)
|
||||||
|
|
||||||
|
|
||||||
# Create the Mako TemplateLookup, with the default auto-escaping
|
# Create the Mako TemplateLookup, with the default auto-escaping
|
||||||
config['pylons.app_globals'].mako_lookup = TemplateLookup(
|
config['pylons.app_globals'].mako_lookup = TemplateLookup(
|
||||||
directories=paths['templates'],
|
directories=paths['templates'],
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# DDPortfolio service middleware configuration
|
# DDPortfolio service middleware configuration
|
||||||
# Copyright © 2009, 2010 Jan Dittberner <jan@dittberner.info>
|
# Copyright © 2009, 2010, 2011, 2012 Jan Dittberner <jan@dittberner.info>
|
||||||
#
|
#
|
||||||
# This file is part of DDPortfolio service.
|
# This file is part of DDPortfolio service.
|
||||||
#
|
#
|
||||||
|
@ -32,6 +32,7 @@ from routes.middleware import RoutesMiddleware
|
||||||
|
|
||||||
from ddportfolioservice.config.environment import load_environment
|
from ddportfolioservice.config.environment import load_environment
|
||||||
|
|
||||||
|
|
||||||
def make_app(global_conf, full_stack=True, static_files=True, **app_conf):
|
def make_app(global_conf, full_stack=True, static_files=True, **app_conf):
|
||||||
"""Create a Pylons WSGI application and return it
|
"""Create a Pylons WSGI application and return it
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# DDPortfolio service routing configuration
|
# DDPortfolio service routing configuration
|
||||||
# Copyright © 2009, 2010 Jan Dittberner <jan@dittberner.info>
|
# Copyright © 2009, 2010, 2011, 2012 Jan Dittberner <jan@dittberner.info>
|
||||||
#
|
#
|
||||||
# This file is part of DDPortfolio service.
|
# This file is part of DDPortfolio service.
|
||||||
#
|
#
|
||||||
|
@ -28,6 +28,7 @@ refer to the routes manual at http://routes.groovie.org/docs/
|
||||||
"""
|
"""
|
||||||
from routes import Mapper
|
from routes import Mapper
|
||||||
|
|
||||||
|
|
||||||
def make_map(config):
|
def make_map(config):
|
||||||
"""Create, configure and return the routes Mapper"""
|
"""Create, configure and return the routes Mapper"""
|
||||||
map = Mapper(directory=config['pylons.paths']['controllers'],
|
map = Mapper(directory=config['pylons.paths']['controllers'],
|
||||||
|
|
|
@ -35,6 +35,7 @@ from ddportfolioservice.model import dddatabuilder
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class DdportfolioController(BaseController):
|
class DdportfolioController(BaseController):
|
||||||
_LABELS = {
|
_LABELS = {
|
||||||
'overview': {
|
'overview': {
|
||||||
|
@ -110,7 +111,8 @@ developer name on all bug logs)'),
|
||||||
'ssh': {
|
'ssh': {
|
||||||
'label': N_('Information reachable via ssh (for Debian Members)'),
|
'label': N_('Information reachable via ssh (for Debian Members)'),
|
||||||
'owndndoms': N_('owned debian.net domains'),
|
'owndndoms': N_('owned debian.net domains'),
|
||||||
'miainfo' : N_('<a href="http://wiki.debian.org/qa.debian.org/MIATeam">MIA</a> database information'),
|
'miainfo': N_('<a href="http://wiki.debian.org/qa.debian.org/'
|
||||||
|
'MIATeam">MIA</a> database information'),
|
||||||
'groupinfo': N_('Group membership information'),
|
'groupinfo': N_('Group membership information'),
|
||||||
},
|
},
|
||||||
'ubuntu': {
|
'ubuntu': {
|
||||||
|
@ -119,7 +121,6 @@ developer name on all bug logs)'),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def _get_label(self, section, url=None):
|
def _get_label(self, section, url=None):
|
||||||
if section in self._LABELS:
|
if section in self._LABELS:
|
||||||
if url:
|
if url:
|
||||||
|
@ -132,9 +133,9 @@ developer name on all bug logs)'),
|
||||||
return section
|
return section
|
||||||
|
|
||||||
def index(self):
|
def index(self):
|
||||||
# Return a rendered template
|
"""
|
||||||
# return render('/some/template.mako')
|
Render the input form.
|
||||||
# or, Return a response
|
"""
|
||||||
return render('/showform.mako')
|
return render('/showform.mako')
|
||||||
|
|
||||||
def urllist(self):
|
def urllist(self):
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# DDPortfolio service ErrorController
|
# DDPortfolio service ErrorController
|
||||||
# Copyright © 2009, 2010 Jan Dittberner <jan@dittberner.info>
|
# Copyright © 2009, 2010, 2011, 2012 Jan Dittberner <jan@dittberner.info>
|
||||||
#
|
#
|
||||||
# This file is part of DDPortfolio service.
|
# This file is part of DDPortfolio service.
|
||||||
#
|
#
|
||||||
|
@ -30,8 +30,8 @@ from webhelpers.html.builder import literal
|
||||||
|
|
||||||
from ddportfolioservice.lib.base import BaseController
|
from ddportfolioservice.lib.base import BaseController
|
||||||
|
|
||||||
class ErrorController(BaseController):
|
|
||||||
|
|
||||||
|
class ErrorController(BaseController):
|
||||||
"""Generates error documents as and when they are required.
|
"""Generates error documents as and when they are required.
|
||||||
|
|
||||||
The ErrorDocuments middleware forwards to ErrorController when error
|
The ErrorDocuments middleware forwards to ErrorController when error
|
||||||
|
@ -39,16 +39,17 @@ class ErrorController(BaseController):
|
||||||
|
|
||||||
This behaviour can be altered by changing the parameters to the
|
This behaviour can be altered by changing the parameters to the
|
||||||
ErrorDocuments middleware in your config/middleware.py file.
|
ErrorDocuments middleware in your config/middleware.py file.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def document(self):
|
def document(self):
|
||||||
"""Render the error document"""
|
"""Render the error document"""
|
||||||
resp = request.environ.get('pylons.original_response')
|
resp = request.environ.get('pylons.original_response')
|
||||||
content = literal(resp.body) or cgi.escape(request.GET.get('message', ''))
|
content = literal(resp.body) or cgi.escape(
|
||||||
|
request.GET.get('message', ''))
|
||||||
page = error_document_template % \
|
page = error_document_template % \
|
||||||
dict(prefix=request.environ.get('SCRIPT_NAME', ''),
|
dict(prefix=request.environ.get('SCRIPT_NAME', ''),
|
||||||
code=cgi.escape(request.GET.get('code', str(resp.status_int))),
|
code=cgi.escape(
|
||||||
|
request.GET.get('code', str(resp.status_int))),
|
||||||
message=content)
|
message=content)
|
||||||
return page
|
return page
|
||||||
|
|
||||||
|
@ -61,8 +62,9 @@ class ErrorController(BaseController):
|
||||||
return self._serve_file('/'.join(['media/style', id]))
|
return self._serve_file('/'.join(['media/style', id]))
|
||||||
|
|
||||||
def _serve_file(self, path):
|
def _serve_file(self, path):
|
||||||
"""Call Paste's FileApp (a WSGI application) to serve the file
|
"""
|
||||||
at the specified path
|
Call Paste's FileApp (a WSGI application) to serve the file at
|
||||||
|
the specified path
|
||||||
"""
|
"""
|
||||||
request.environ['PATH_INFO'] = '/%s' % path
|
request.environ['PATH_INFO'] = '/%s' % path
|
||||||
return forward(PkgResourcesParser('pylons', 'pylons'))
|
return forward(PkgResourcesParser('pylons', 'pylons'))
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# DDPortfolio service ShowformscriptController.
|
# DDPortfolio service ShowformscriptController.
|
||||||
# Copyright © 2009, 2010 Jan Dittberner <jan@dittberner.info>
|
# Copyright © 2009, 2010, 2011, 2012 Jan Dittberner <jan@dittberner.info>
|
||||||
#
|
#
|
||||||
# This file is part of DDPortfolio service.
|
# This file is part of DDPortfolio service.
|
||||||
#
|
#
|
||||||
|
@ -34,6 +34,7 @@ from ddportfolioservice.model import dddatabuilder
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class ShowformscriptsController(BaseController):
|
class ShowformscriptsController(BaseController):
|
||||||
"""This controller is used to support data entry in showform.
|
"""This controller is used to support data entry in showform.
|
||||||
|
|
||||||
|
@ -41,12 +42,17 @@ class ShowformscriptsController(BaseController):
|
||||||
responses for autocompletion of fields."""
|
responses for autocompletion of fields."""
|
||||||
|
|
||||||
def index(self):
|
def index(self):
|
||||||
"""This action generates the helper script for the showform
|
"""
|
||||||
page."""
|
This action generates the helper script for the showform page.
|
||||||
|
"""
|
||||||
response.headers['Content-Type'] = 'text/javascript; charset=utf-8'
|
response.headers['Content-Type'] = 'text/javascript; charset=utf-8'
|
||||||
return render('/showformscript.mako')
|
return render('/showformscript.mako')
|
||||||
|
|
||||||
def fetchdddata(self):
|
def fetchdddata(self):
|
||||||
|
"""
|
||||||
|
This action fetches the data for a given mail address and
|
||||||
|
returns them as JSON.
|
||||||
|
"""
|
||||||
schema = DDDataRequest()
|
schema = DDDataRequest()
|
||||||
try:
|
try:
|
||||||
formencode.api.set_stdtranslation(
|
formencode.api.set_stdtranslation(
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# DDPortfolio service TemplateController
|
# DDPortfolio service TemplateController
|
||||||
# Copyright © 2009, 2010 Jan Dittberner <jan@dittberner.info>
|
# Copyright © 2009, 2010, 2011, 2012 Jan Dittberner <jan@dittberner.info>
|
||||||
#
|
#
|
||||||
# This file is part of DDPortfolio service.
|
# This file is part of DDPortfolio service.
|
||||||
#
|
#
|
||||||
|
@ -22,6 +22,7 @@
|
||||||
#
|
#
|
||||||
from ddportfolioservice.lib.base import BaseController
|
from ddportfolioservice.lib.base import BaseController
|
||||||
|
|
||||||
|
|
||||||
class TemplateController(BaseController):
|
class TemplateController(BaseController):
|
||||||
|
|
||||||
def view(self, url):
|
def view(self, url):
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# DDPortfolio service application Globals
|
# DDPortfolio service application Globals
|
||||||
# Copyright © 2009, 2010 Jan Dittberner <jan@dittberner.info>
|
# Copyright © 2009, 2010, 2011, 2012 Jan Dittberner <jan@dittberner.info>
|
||||||
#
|
#
|
||||||
# This file is part of DDPortfolio service.
|
# This file is part of DDPortfolio service.
|
||||||
#
|
#
|
||||||
|
@ -25,17 +25,17 @@
|
||||||
from beaker.cache import CacheManager
|
from beaker.cache import CacheManager
|
||||||
from beaker.util import parse_cache_config_options
|
from beaker.util import parse_cache_config_options
|
||||||
|
|
||||||
|
|
||||||
class Globals(object):
|
class Globals(object):
|
||||||
|
"""
|
||||||
"""Globals acts as a container for objects available throughout the
|
Globals acts as a container for objects available throughout the
|
||||||
life of the application
|
life of the application
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, config):
|
def __init__(self, config):
|
||||||
"""One instance of Globals is created during application
|
"""
|
||||||
|
One instance of Globals is created during application
|
||||||
initialization and is available during requests via the
|
initialization and is available during requests via the
|
||||||
'app_globals' variable
|
'app_globals' variable
|
||||||
|
|
||||||
"""
|
"""
|
||||||
self.cache = CacheManager(**parse_cache_config_options(config))
|
self.cache = CacheManager(**parse_cache_config_options(config))
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# DDPortfolio service base controller
|
# DDPortfolio service base controller
|
||||||
# Copyright © 2009, 2010 Jan Dittberner <jan@dittberner.info>
|
# Copyright © 2009, 2010, 2011, 2012 Jan Dittberner <jan@dittberner.info>
|
||||||
#
|
#
|
||||||
# This file is part of DDPortfolio service.
|
# This file is part of DDPortfolio service.
|
||||||
#
|
#
|
||||||
|
@ -29,6 +29,7 @@ from pylons.controllers import WSGIController
|
||||||
from pylons.i18n import add_fallback
|
from pylons.i18n import add_fallback
|
||||||
from pylons.templating import render_mako as render
|
from pylons.templating import render_mako as render
|
||||||
|
|
||||||
|
|
||||||
class BaseController(WSGIController):
|
class BaseController(WSGIController):
|
||||||
|
|
||||||
def __call__(self, environ, start_response):
|
def __call__(self, environ, start_response):
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# DDPortfolio service form handling model
|
# DDPortfolio service form handling model
|
||||||
# Copyright © 2009, 2010 Jan Dittberner <jan@dittberner.info>
|
# Copyright © 2009, 2010, 2011, 2012 Jan Dittberner <jan@dittberner.info>
|
||||||
#
|
#
|
||||||
# This file is part of DDPortfolio service.
|
# This file is part of DDPortfolio service.
|
||||||
#
|
#
|
||||||
|
@ -22,6 +22,7 @@
|
||||||
#
|
#
|
||||||
import formencode
|
import formencode
|
||||||
|
|
||||||
|
|
||||||
class DeveloperData(formencode.Schema):
|
class DeveloperData(formencode.Schema):
|
||||||
"""Validation schema for DeveloperData."""
|
"""Validation schema for DeveloperData."""
|
||||||
allow_extra_fields = True
|
allow_extra_fields = True
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# DDPortfolio service key finder module
|
# DDPortfolio service key finder module
|
||||||
# Copyright (c) 2009 Jan Dittberner <jan@dittberner.info>
|
# Copyright (c) 2009, 2010, 2011, 2012 Jan Dittberner <jan@dittberner.info>
|
||||||
#
|
#
|
||||||
# This file is part of DDPortfolio service.
|
# This file is part of DDPortfolio service.
|
||||||
#
|
#
|
||||||
|
@ -30,6 +30,7 @@ import time
|
||||||
db = None
|
db = None
|
||||||
cachetimestamp = 0
|
cachetimestamp = 0
|
||||||
|
|
||||||
|
|
||||||
def _get_keyring_cache():
|
def _get_keyring_cache():
|
||||||
global db, cachetimestamp
|
global db, cachetimestamp
|
||||||
if db is None or (time.time() - cachetimestamp) > 86300:
|
if db is None or (time.time() - cachetimestamp) > 86300:
|
||||||
|
@ -44,6 +45,7 @@ def _get_keyring_cache():
|
||||||
cachetimestamp = time.time()
|
cachetimestamp = time.time()
|
||||||
return db
|
return db
|
||||||
|
|
||||||
|
|
||||||
def _get_cached(cachekey):
|
def _get_cached(cachekey):
|
||||||
cache = _get_keyring_cache()
|
cache = _get_keyring_cache()
|
||||||
logging.debug('cache lookup for %s', cachekey)
|
logging.debug('cache lookup for %s', cachekey)
|
||||||
|
@ -52,25 +54,33 @@ def _get_cached(cachekey):
|
||||||
return cache[cachekey]
|
return cache[cachekey]
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
def getFingerprintByEmail(email):
|
def getFingerprintByEmail(email):
|
||||||
"""Gets the fingerprints associated with the given email address
|
"""
|
||||||
if available."""
|
Gets the fingerprints associated with the given email address if
|
||||||
|
available.
|
||||||
|
"""
|
||||||
return _get_cached('fpr:email:%s' % email)
|
return _get_cached('fpr:email:%s' % email)
|
||||||
|
|
||||||
|
|
||||||
def getRealnameByEmail(email):
|
def getRealnameByEmail(email):
|
||||||
"""Gets the real names associated with the given email address if
|
"""
|
||||||
available."""
|
Gets the real names associated with the given email address if
|
||||||
|
available.
|
||||||
|
"""
|
||||||
return _get_cached('name:email:%s' % email)
|
return _get_cached('name:email:%s' % email)
|
||||||
|
|
||||||
|
|
||||||
def getLoginByEmail(email):
|
def getLoginByEmail(email):
|
||||||
"""Gets the logins associated with the given email address if
|
"""
|
||||||
available."""
|
Gets the logins associated with the given email address if
|
||||||
|
available.
|
||||||
|
"""
|
||||||
return _get_cached('login:email:%s' % email)
|
return _get_cached('login:email:%s' % email)
|
||||||
|
|
||||||
|
|
||||||
def getLoginByFingerprint(fpr):
|
def getLoginByFingerprint(fpr):
|
||||||
"""Gets the login associated with the given fingerprint if
|
"""
|
||||||
available."""
|
Gets the login associated with the given fingerprint if available.
|
||||||
|
"""
|
||||||
return _get_cached('login:fpr:%s' % fpr)
|
return _get_cached('login:fpr:%s' % fpr)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# DDPortfolio service application key ring analyzer tool
|
# DDPortfolio service application key ring analyzer tool
|
||||||
# Copyright © 2009, 2010 Jan Dittberner <jan@dittberner.info>
|
# Copyright © 2009, 2010, 2011, 2012 Jan Dittberner <jan@dittberner.info>
|
||||||
#
|
#
|
||||||
# This file is part of DDPortfolio service.
|
# This file is part of DDPortfolio service.
|
||||||
#
|
#
|
||||||
|
@ -38,10 +38,13 @@ import sys
|
||||||
|
|
||||||
|
|
||||||
def _get_keyrings():
|
def _get_keyrings():
|
||||||
"""Gets the available keyring files from the keyring directory
|
"""
|
||||||
configured in ddportfolio.ini."""
|
Gets the available keyring files from the keyring directory
|
||||||
|
configured in ddportfolio.ini.
|
||||||
|
"""
|
||||||
my_config = ConfigParser.ConfigParser()
|
my_config = ConfigParser.ConfigParser()
|
||||||
my_config.readfp(pkg_resources.resource_stream(__name__, 'ddportfolio.ini'))
|
my_config.readfp(pkg_resources.resource_stream(
|
||||||
|
__name__, 'ddportfolio.ini'))
|
||||||
keyringdir = os.path.expanduser(my_config.get('DEFAULT', 'keyring.dir'))
|
keyringdir = os.path.expanduser(my_config.get('DEFAULT', 'keyring.dir'))
|
||||||
logging.debug("keyring dir is %s", keyringdir)
|
logging.debug("keyring dir is %s", keyringdir)
|
||||||
keyrings = glob.glob(os.path.join(keyringdir, '*.gpg'))
|
keyrings = glob.glob(os.path.join(keyringdir, '*.gpg'))
|
||||||
|
@ -51,8 +54,10 @@ def _get_keyrings():
|
||||||
|
|
||||||
|
|
||||||
def _parse_uid(uid):
|
def _parse_uid(uid):
|
||||||
"""Parse a uid of the form 'Real Name <email@example.com>' into
|
"""
|
||||||
email and realname parts."""
|
Parse a uid of the form 'Real Name <email@example.com>' into email
|
||||||
|
and realname parts.
|
||||||
|
"""
|
||||||
uid = uid.strip()
|
uid = uid.strip()
|
||||||
# First, strip comment
|
# First, strip comment
|
||||||
s = uid.find('(')
|
s = uid.find('(')
|
||||||
|
@ -72,6 +77,7 @@ def _parse_uid(uid):
|
||||||
|
|
||||||
resultdict = {}
|
resultdict = {}
|
||||||
|
|
||||||
|
|
||||||
def _get_canonical(key):
|
def _get_canonical(key):
|
||||||
if not key in resultdict:
|
if not key in resultdict:
|
||||||
resultdict[key] = []
|
resultdict[key] = []
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf8 -*-
|
# -*- coding: utf8 -*-
|
||||||
#
|
#
|
||||||
# DDPortfolio service url builder
|
# DDPortfolio service url builder
|
||||||
# Copyright © 2009, 2010, 2012 Jan Dittberner <jan@dittberner.info>
|
# Copyright © 2009, 2010, 2011, 2012 Jan Dittberner <jan@dittberner.info>
|
||||||
#
|
#
|
||||||
# This file is part of DDPortfolio service.
|
# This file is part of DDPortfolio service.
|
||||||
#
|
#
|
||||||
|
@ -82,7 +82,8 @@ def build_urls(fields):
|
||||||
'urlbuilder.sections').split(',')]:
|
'urlbuilder.sections').split(',')]:
|
||||||
data.append(['section', section])
|
data.append(['section', section])
|
||||||
if my_config.has_option(section, 'urls'):
|
if my_config.has_option(section, 'urls'):
|
||||||
for entry in ([DDPortfolioEntry(my_config, section, url) for url in \
|
for entry in ([
|
||||||
|
DDPortfolioEntry(my_config, section, url) for url in \
|
||||||
my_config.get(section, 'urls').split(',')]):
|
my_config.get(section, 'urls').split(',')]):
|
||||||
try:
|
try:
|
||||||
data.append(
|
data.append(
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# DDPortfolio service tests package
|
# DDPortfolio service tests package
|
||||||
# Copyright © 2009, 2010 Jan Dittberner <jan@dittberner.info>
|
# Copyright © 2009, 2010, 2011, 2012 Jan Dittberner <jan@dittberner.info>
|
||||||
#
|
#
|
||||||
# This file is part of DDPortfolio service.
|
# This file is part of DDPortfolio service.
|
||||||
#
|
#
|
||||||
|
@ -49,6 +49,7 @@ SetupCommand('setup-app').run([pylons.test.pylonsapp.config['__file__']])
|
||||||
|
|
||||||
environ = {}
|
environ = {}
|
||||||
|
|
||||||
|
|
||||||
class TestController(TestCase):
|
class TestController(TestCase):
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# DDPortfolio service DdportfolioController test
|
# DDPortfolio service DdportfolioController test
|
||||||
# Copyright © 2009, 2010 Jan Dittberner <jan@dittberner.info>
|
# Copyright © 2009, 2010, 2011, 2012 Jan Dittberner <jan@dittberner.info>
|
||||||
#
|
#
|
||||||
# This file is part of DDPortfolio service.
|
# This file is part of DDPortfolio service.
|
||||||
#
|
#
|
||||||
|
@ -22,8 +22,10 @@
|
||||||
#
|
#
|
||||||
from ddportfolioservice.tests import TestController, url
|
from ddportfolioservice.tests import TestController, url
|
||||||
|
|
||||||
|
|
||||||
class TestShowformscriptsController(TestController):
|
class TestShowformscriptsController(TestController):
|
||||||
|
|
||||||
def test_index(self):
|
def test_index(self):
|
||||||
response = self.app.get(url(controller='showformscripts', action='index'))
|
response = self.app.get(
|
||||||
|
url(controller='showformscripts', action='index'))
|
||||||
# Test response...
|
# Test response...
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# DDPortfolio service websetup
|
# DDPortfolio service websetup
|
||||||
# Copyright (c) 2009 Jan Dittberner <jan@dittberner.info>
|
# Copyright (c) 2009, 2010, 2011, 2012 Jan Dittberner <jan@dittberner.info>
|
||||||
#
|
#
|
||||||
# This file is part of DDPortfolio service.
|
# This file is part of DDPortfolio service.
|
||||||
#
|
#
|
||||||
|
@ -31,6 +31,7 @@ from ddportfolioservice.config.environment import load_environment
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def setup_config(command, filename, section, vars):
|
def setup_config(command, filename, section, vars):
|
||||||
"""Place any commands to setup ddportfolioservice here"""
|
"""Place any commands to setup ddportfolioservice here"""
|
||||||
conf = appconfig('config:' + filename)
|
conf = appconfig('config:' + filename)
|
||||||
|
|
Loading…
Reference in a new issue