Beispiel #1
0
 def __init__(self):
     self.translations_path = path.join(path.dirname(__file__), 'translations') 
     self.mydomain = Domain(self.translations_path)
     _ = self.mydomain.lazy_gettext
     self.title = _(u'Tactical overview')
     self.description = _(u'The total number of hosts and service with and without problems')
     self.version = "0.1"
     self.name = "tactical_overview"
Beispiel #2
0
 def __init__(self):
     self.translations_path = path.join(path.dirname(__file__),
                                        'translations')
     self.mydomain = Domain(self.translations_path)
     _ = self.mydomain.lazy_gettext
     self.title = _(u'About Sageo')
     self.description = _(
         u'Version information and Links to Documentation, Homepage and Download of Sageo'
     )
     self.version = app.config["SAGEO_VERSION"]
     self.name = "about"
Beispiel #3
0
 def __init__(self):
     #import ipdb;ipdb.set_trace()
     self.translations_path = path.join(path.dirname(__file__),
                                        'translations')
     self.mydomain = Domain(self.translations_path)
     _ = self.mydomain.lazy_gettext
     self.title = _(u'About Sageo')
     self.description = _(
         u'Version information and Links to Documentation, Homepage and Download of Check_MK'
     )
     self.version = "0.1"
     self.name = "about"
Beispiel #4
0
from flask import render_template, jsonify, request
from markupsafe import Markup
from appshell.markup import element, link_button, button, xmltag
from appshell.urls import res_url, url_or_url_for
from appshell.templates import widgets, dropdowns, modals
import iso8601
import datetime
import json

from flask.ext.babelex import Babel, Domain

mydomain = Domain('appshell')
_ = mydomain.gettext
lazy_gettext = mydomain.lazy_gettext


class Column(object):
    orderable = True

    def __init__(self,
                 name,
                 filter=None,
                 options={},
                 orderable=None,
                 convert=None,
                 data_proc=None,
                 **kwargs):
        self.name = name
        self.header = Markup("<th>{0}</th>").format(name)
        self.filter = filter
        self._options = options
Beispiel #5
0
from flask.ext.babelex import Babel, Domain
from flask.ext.mustache import FlaskMustache
from ._version import *
from .assets import assets, Version
from . import translations

__all__ = [
    'baseframe', 'baseframe_js', 'baseframe_css', 'assets', 'Version', '_',
    '__'
]

networkbar_cache = Cache(with_jinja2_ext=False)
cache = Cache()
babel = Babel()

baseframe_translations = Domain(translations.__path__[0], domain='baseframe')
_ = baseframe_translations.gettext
__ = baseframe_translations.lazy_gettext


class BaseframeBlueprint(Blueprint):
    def init_app(self,
                 app,
                 requires=[],
                 bundle_js=None,
                 bundle_css=None,
                 assetenv=None):
        """
        Initialize an app and load necessary assets.

        :param requires: List of required assets. If an asset has both .js
Beispiel #6
0
from flask.ext.babelex import Domain
from os import environ, listdir
from os.path import join

trans_dir = join(environ["OPENSHIFT_REPO_DIR"], "translations")
messages_domain = Domain(trans_dir, domain="messages")
parts_domain = Domain(trans_dir, domain="parts")
docs_domain = Domain(trans_dir, domain="docs")

languages = listdir(trans_dir) + ['en']


def gettext_parts(msgid):
    return parts_domain.gettext(msgid)


def gettext_docs(msgid):
    return docs_domain.gettext(msgid)
Beispiel #7
0
from flask.signals import Namespace

from . import translations
from ._version import *  # NOQA

# Signals
lastuser_signals = Namespace()

signal_user_session_refreshed = lastuser_signals.signal(
    'user-session-refreshed')
signal_user_session_expired = lastuser_signals.signal('user-session-expired')
signal_user_looked_up = lastuser_signals.signal('user-looked-up')
signal_before_wrapped_view = lastuser_signals.signal('before-wrapped-view')

# Translations
flask_lastuser_translations = Domain(translations.__path__[0],
                                     domain='flask_lastuser')
_ = flask_lastuser_translations.gettext
__ = flask_lastuser_translations.lazy_gettext

# Bearer token, as per http://tools.ietf.org/html/draft-ietf-oauth-v2-bearer-15#section-2.1
auth_bearer_re = re.compile("^Bearer ([a-zA-Z0-9_.~+/-]+=*)$")


class LastuserConfigException(Exception):
    pass


class LastuserException(Exception):
    pass