Example #1
0
def register_module():
    """Registers this module in the registry."""

    yui_handlers = [('/static/inputex-3.1.0/(.*)',
                     sites.make_zip_handler(
                         os.path.join(appengine_config.BUNDLE_ROOT,
                                      'lib/inputex-3.1.0.zip'))),
                    ('/static/yui_3.6.0/(.*)',
                     sites.make_zip_handler(
                         os.path.join(appengine_config.BUNDLE_ROOT,
                                      'lib/yui_3.6.0.zip'))),
                    ('/static/2in3/(.*)',
                     sites.make_zip_handler(
                         os.path.join(appengine_config.BUNDLE_ROOT,
                                      'lib/yui_2in3-2.9.0.zip')))]

    codemirror_handler = [('/static/codemirror/(.*)',
                           sites.make_zip_handler(
                               os.path.join(appengine_config.BUNDLE_ROOT,
                                            'lib/codemirror-4.5.0.zip')))]

    if appengine_config.BUNDLE_LIB_FILES:
        yui_handlers += [('/static/combo/inputex',
                          sites.make_css_combo_zip_handler(
                              os.path.join(appengine_config.BUNDLE_ROOT,
                                           'lib/inputex-3.1.0.zip'),
                              '/static/inputex-3.1.0/')),
                         ('/static/combo/yui',
                          sites.make_css_combo_zip_handler(
                              os.path.join(appengine_config.BUNDLE_ROOT,
                                           'lib/yui_3.6.0.zip'), '/yui/')),
                         ('/static/combo/2in3',
                          sites.make_css_combo_zip_handler(
                              os.path.join(appengine_config.BUNDLE_ROOT,
                                           'lib/yui_2in3-2.9.0.zip'),
                              '/static/2in3/'))]

    namespaced_routes = [('/oeditorpopup', PopupHandler),
                         ('/oeditor/preview', PreviewHandler),
                         ('/oeditor/rest/editor_prefs', EditorPrefsRestHandler)
                         ]

    global_routes = yui_handlers + codemirror_handler + [
        ('/modules/oeditor/buttonbar.css', ButtonbarCssHandler),
        (RESOURCES_URI + '/.*', tags.ResourcesHandler)
    ]

    global custom_module  # pylint: disable=global-statement
    custom_module = custom_modules.Module(
        'Object Editor',
        'A visual editor for editing various types of objects.', global_routes,
        namespaced_routes)
    return custom_module
def register_module():
    """Registers this module in the registry."""

    from controllers import sites

    yui_handlers = [('/static/inputex-3.1.0/(.*)',
                     sites.make_zip_handler(
                         os.path.join(appengine_config.BUNDLE_ROOT,
                                      'lib/inputex-3.1.0.zip'))),
                    ('/static/yui_3.6.0/(.*)',
                     sites.make_zip_handler(
                         os.path.join(appengine_config.BUNDLE_ROOT,
                                      'lib/yui_3.6.0.zip'))),
                    ('/static/2in3/(.*)',
                     sites.make_zip_handler(
                         os.path.join(appengine_config.BUNDLE_ROOT,
                                      'lib/yui_2in3-2.9.0.zip')))]

    codemirror_handler = [('/static/codemirror/(.*)',
                           sites.make_zip_handler(
                               os.path.join(appengine_config.BUNDLE_ROOT,
                                            'lib/codemirror-4.5.0.zip')))]

    if appengine_config.BUNDLE_LIB_FILES:
        yui_handlers += [('/static/combo/inputex',
                          sites.make_css_combo_zip_handler(
                              os.path.join(appengine_config.BUNDLE_ROOT,
                                           'lib/inputex-3.1.0.zip'),
                              '/static/inputex-3.1.0/')),
                         ('/static/combo/yui',
                          sites.make_css_combo_zip_handler(
                              os.path.join(appengine_config.BUNDLE_ROOT,
                                           'lib/yui_3.6.0.zip'), '/yui/')),
                         ('/static/combo/2in3',
                          sites.make_css_combo_zip_handler(
                              os.path.join(appengine_config.BUNDLE_ROOT,
                                           'lib/yui_2in3-2.9.0.zip'),
                              '/static/2in3/'))]

    oeditor_handlers = [('/oeditorpopup', PopupHandler)]
    global_routes = yui_handlers + codemirror_handler + [(os.path.join(
        RESOURCES_PATH, '.*'), tags.ResourcesHandler)]

    global custom_module  # pylint: disable=global-statement
    custom_module = custom_modules.Module(
        'Object Editor',
        'A visual editor for editing various types of objects.', global_routes,
        oeditor_handlers)
    return custom_module
Example #3
0
def register_module():
    """Registers this module in the registry."""

    yui_handlers = [
        ('/static/inputex-3.1.0/(.*)', sites.make_zip_handler(
            os.path.join(
                appengine_config.BUNDLE_ROOT, 'lib/inputex-3.1.0.zip'))),
        ('/static/yui_3.6.0/(.*)', sites.make_zip_handler(
            os.path.join(
                appengine_config.BUNDLE_ROOT, 'lib/yui_3.6.0.zip'))),
        ('/static/2in3/(.*)', sites.make_zip_handler(
            os.path.join(
                appengine_config.BUNDLE_ROOT, 'lib/yui_2in3-2.9.0.zip')))]

    codemirror_handler = [
        ('/static/codemirror/(.*)', sites.make_zip_handler(
            os.path.join(
                appengine_config.BUNDLE_ROOT, 'lib/codemirror-4.5.0.zip')))]

    if appengine_config.BUNDLE_LIB_FILES:
        yui_handlers += [
            ('/static/combo/inputex', sites.make_css_combo_zip_handler(
                os.path.join(
                    appengine_config.BUNDLE_ROOT, 'lib/inputex-3.1.0.zip'),
                '/static/inputex-3.1.0/')),
            ('/static/combo/yui', sites.make_css_combo_zip_handler(
                os.path.join(appengine_config.BUNDLE_ROOT, 'lib/yui_3.6.0.zip'),
                '/yui/')),
            ('/static/combo/2in3', sites.make_css_combo_zip_handler(
                os.path.join(
                    appengine_config.BUNDLE_ROOT, 'lib/yui_2in3-2.9.0.zip'),
                '/static/2in3/'))]

    namespaced_routes = [
        ('/oeditorpopup', PopupHandler),
        ('/oeditor/preview', PreviewHandler),
        ('/oeditor/rest/editor_prefs', EditorPrefsRestHandler)]

    global_routes = yui_handlers + codemirror_handler + [
        ('/modules/oeditor/buttonbar.css', ButtonbarCssHandler),
        (RESOURCES_URI +'/.*', tags.ResourcesHandler)]

    global custom_module  # pylint: disable=global-statement
    custom_module = custom_modules.Module(
        'Object Editor',
        'A visual editor for editing various types of objects.',
        global_routes, namespaced_routes)
    return custom_module
def register_module():
    """Registers this module in the registry."""

    from controllers import sites  # pylint: disable-msg=g-import-not-at-top

    yui_handlers = [
        ('/static/inputex-3.1.0/(.*)', sites.make_zip_handler(
            os.path.join(
                appengine_config.BUNDLE_ROOT, 'lib/inputex-3.1.0.zip'))),
        ('/static/yui_3.6.0/(.*)', sites.make_zip_handler(
            os.path.join(
                appengine_config.BUNDLE_ROOT, 'lib/yui_3.6.0.zip'))),
        ('/static/2in3/(.*)', sites.make_zip_handler(
            os.path.join(
                appengine_config.BUNDLE_ROOT, 'lib/yui_2in3-2.9.0.zip')))]

    codemirror_handler = [
        ('/static/codemirror/(.*)', sites.make_zip_handler(
            os.path.join(
                appengine_config.BUNDLE_ROOT, 'lib/codemirror-4.5.0.zip')))]

    if appengine_config.BUNDLE_LIB_FILES:
        yui_handlers += [
            ('/static/combo/inputex', sites.make_css_combo_zip_handler(
                os.path.join(
                    appengine_config.BUNDLE_ROOT, 'lib/inputex-3.1.0.zip'),
                '/static/inputex-3.1.0/')),
            ('/static/combo/yui', sites.make_css_combo_zip_handler(
                os.path.join(appengine_config.BUNDLE_ROOT, 'lib/yui_3.6.0.zip'),
                '/yui/')),
            ('/static/combo/2in3', sites.make_css_combo_zip_handler(
                os.path.join(
                    appengine_config.BUNDLE_ROOT, 'lib/yui_2in3-2.9.0.zip'),
                '/static/2in3/'))]

    oeditor_handlers = [('/oeditorpopup', PopupHandler)]
    global_routes = yui_handlers + codemirror_handler + [
        (os.path.join(RESOURCES_PATH, '.*'), tags.ResourcesHandler)]

    global custom_module
    custom_module = custom_modules.Module(
        'Object Editor',
        'A visual editor for editing various types of objects.',
        global_routes, oeditor_handlers)
    return custom_module
Example #5
0
def register_module():
    """Registers this module in the registry."""

    from controllers import sites  # pylint: disable-msg=g-import-not-at-top

    yui_handlers = [('/static/inputex-3.1.0/(.*)',
                     sites.make_zip_handler(
                         os.path.join(appengine_config.BUNDLE_ROOT,
                                      'lib/inputex-3.1.0.zip'))),
                    ('/static/yui_3.6.0/(.*)',
                     sites.make_zip_handler(
                         os.path.join(appengine_config.BUNDLE_ROOT,
                                      'lib/yui_3.6.0.zip'))),
                    ('/static/2in3/(.*)',
                     sites.make_zip_handler(
                         os.path.join(appengine_config.BUNDLE_ROOT,
                                      'lib/yui_2in3-2.9.0.zip')))]

    if appengine_config.BUNDLE_LIB_FILES:
        yui_handlers += [('/static/combo/inputex',
                          sites.make_css_combo_zip_handler(
                              os.path.join(appengine_config.BUNDLE_ROOT,
                                           'lib/inputex-3.1.0.zip'),
                              '/static/inputex-3.1.0/')),
                         ('/static/combo/yui',
                          sites.make_css_combo_zip_handler(
                              os.path.join(appengine_config.BUNDLE_ROOT,
                                           'lib/yui_3.6.0.zip'), '/yui/')),
                         ('/static/combo/2in3',
                          sites.make_css_combo_zip_handler(
                              os.path.join(appengine_config.BUNDLE_ROOT,
                                           'lib/yui_2in3-2.9.0.zip'),
                              '/static/2in3/'))]

    oeditor_handlers = [('/oeditorpopup', PopupHandler)]

    global custom_module
    custom_module = custom_modules.Module(
        'Object Editor',
        'A visual editor for editing various types of objects.', yui_handlers,
        oeditor_handlers)
    return custom_module
Example #6
0
                 sites.make_zip_handler(
                     os.path.join(appengine_config.BUNDLE_ROOT,
                                  'lib/inputex-3.1.0.zip'))),
                ('/static/yui_3.6.0/(.*)',
                 sites.make_zip_handler(
                     os.path.join(appengine_config.BUNDLE_ROOT,
                                  'lib/yui_3.6.0.zip'))),
                ('/static/2in3/(.*)',
                 sites.make_zip_handler(
                     os.path.join(appengine_config.BUNDLE_ROOT,
                                  'lib/yui_2in3-2.9.0.zip')))]

if appengine_config.BUNDLE_LIB_FILES:
    yui_handlers += [('/static/combo/inputex',
                      sites.make_css_combo_zip_handler(
                          os.path.join(appengine_config.BUNDLE_ROOT,
                                       'lib/inputex-3.1.0.zip'),
                          '/static/inputex-3.1.0/')),
                     ('/static/combo/yui',
                      sites.make_css_combo_zip_handler(
                          os.path.join(appengine_config.BUNDLE_ROOT,
                                       'lib/yui_3.6.0.zip'), '/yui/')),
                     ('/static/combo/2in3',
                      sites.make_css_combo_zip_handler(
                          os.path.join(appengine_config.BUNDLE_ROOT,
                                       'lib/yui_2in3-2.9.0.zip'),
                          '/static/2in3/'))]

admin_handlers = [('/admin', admin.AdminHandler),
                  ('/rest/config/item', config.ConfigPropertyItemRESTHandler),
                  ('/rest/courses/item', config.CoursesItemRESTHandler)]
    ('/home', utils.HomeHandler)]

sites.ApplicationRequestHandler.bind(urls)

yui_handlers = [
    ('/static/inputex-3.1.0/(.*)', sites.make_zip_handler(
        os.path.join(appengine_config.BUNDLE_ROOT, 'lib/inputex-3.1.0.zip'))),
    ('/static/yui_3.6.0/(.*)', sites.make_zip_handler(
        os.path.join(appengine_config.BUNDLE_ROOT, 'lib/yui_3.6.0.zip'))),
    ('/static/2in3/(.*)', sites.make_zip_handler(
        os.path.join(appengine_config.BUNDLE_ROOT, 'lib/yui_2in3-2.9.0.zip')))]

if appengine_config.BUNDLE_LIB_FILES:
    yui_handlers += [
        ('/static/combo/inputex', sites.make_css_combo_zip_handler(
            os.path.join(appengine_config.BUNDLE_ROOT, 'lib/inputex-3.1.0.zip'),
            '/static/inputex-3.1.0/')),
        ('/static/combo/yui', sites.make_css_combo_zip_handler(
            os.path.join(appengine_config.BUNDLE_ROOT, 'lib/yui_3.6.0.zip'),
            '/yui/')),
        ('/static/combo/2in3', sites.make_css_combo_zip_handler(
            os.path.join(
                appengine_config.BUNDLE_ROOT, 'lib/yui_2in3-2.9.0.zip'),
            '/static/2in3/'))]

admin_handlers = [
    ('/admin', admin.AdminHandler),
    ('/rest/config/item', config.ConfigPropertyItemRESTHandler),
    ('/rest/courses/item', config.CoursesItemRESTHandler)]

app_handler = (r'(.*)', sites.ApplicationRequestHandler)