Esempio n. 1
0
    UnencryptedCookieSessionFactoryConfig as SessionFactory)
import pyramid_zcml
from events import AppRootReady
from w20e.forms.registry import Registry
from w20e.forms.pyramid.file import PyramidFile
from models.imagefolder import ImageFolder
from json_adapters import register_json_adapters
from migration import migrate
import pkg_resources


Registry.register_renderable("file", PyramidFile)

tpl_path = os.path.join(os.path.dirname(__file__),
                        "templates/w20e_forms_overrides/")
Registry.add_html_template_path(tpl_path)
Registry.add_html_template_path("./bootstrap")

here = os.path.abspath(os.path.dirname(__file__))
version = pkg_resources.get_distribution("w20e.pycms").version


def class_from_string(clazz_name):

    """ We'll need to follow the dotted path, and find the module that
    starts with some part, and provides the rest of the path... """

    clazz_path = clazz_name.split(".")

    if len(clazz_path) == 1:
        mod_name = __name__