Ejemplo n.º 1
0
 def publish(self, request, part):
     """
     this function works as a simple publisher class for request sent to default version
     
     :part: the first component of the request
     :returns: a quixote compatible ui object or module
     """
     publisher = get_publisher()
     publisher.namespace_stack.append(self)
     return self._publish(part)
Ejemplo n.º 2
0
    def publish(self, request, part):
        """
        this function works as a simple publisher class for request sent to default version

        :part: the first component of the request
        :returns: a quixote compatible ui object or module
        """
        publisher = get_publisher()
        publisher.namespace_stack.append(self)
        return self._publish(part)
Ejemplo n.º 3
0
from quixote.util import StaticFile

from canary.qx_defs import NotLoggedInError
from canary.qx_utils import MyStaticFile, load_static_exports
from canary.ui import about, admin, assistant, edit, user, record_ui, opensearch
from canary.ui.browse_ui import Browse
from canary.ui.pages import _q_index, _q_exception_handler, not_found, reaper
from canary.ui.pages import login_general, login_yale, logout
from canary.ui.pages import register, verify, resetpass
from canary.ui.pages import news, robots, unapi, TempImage
from canary.ui.search import search, advanced_search
from canary.ui.summary_ui import Summary

record = record_ui

config = get_publisher().config

this_module = sys.modules[__name__]
login = getattr(this_module, 'login_%s' % config.authn_mode)


def error(request):
    raise PublishError(public_msg="Oops, an error occured.")


def _q_lookup(request, name=''):
    if name == 'favicon.ico':
        return request.redirect('/images/favicon.ico')
    elif name == 'wdd_styles.css':
        return StaticFile(config.static_html_dir + '/wdd_styles.css',
                          mime_type='text/css',
Ejemplo n.º 4
0
from quixote.util import StaticFile

from canary.qx_defs import NotLoggedInError
from canary.qx_utils import MyStaticFile, load_static_exports
from canary.ui import about, admin, assistant, edit, user, record_ui, opensearch
from canary.ui.browse_ui import Browse
from canary.ui.pages import _q_index, _q_exception_handler, not_found, reaper
from canary.ui.pages import login_general, login_yale, logout
from canary.ui.pages import register, verify, resetpass
from canary.ui.pages import news, robots, unapi, TempImage
from canary.ui.search import search, advanced_search
from canary.ui.summary_ui import Summary

record = record_ui

config = get_publisher().config

this_module = sys.modules[__name__]
login = getattr(this_module, 'login_%s' % config.authn_mode)


def error (request):
    raise PublishError(public_msg = "Oops, an error occured.")


def _q_lookup (request, name=''):
    if name == 'favicon.ico':
        return request.redirect('/images/favicon.ico')
    elif name == 'wdd_styles.css':
        return StaticFile(config.static_html_dir + '/wdd_styles.css',
            mime_type='text/css', cache_time=300)