def __init__(self, db_module, keywords): """Creates a database. """ # some DB implementaions take optional paramater `driver` to use a specific driver modue # but it should not be passed to connect keywords.pop('driver', None) self.db_module = db_module self.keywords = keywords self._ctx = threadeddict() # flag to enable/disable printing queries self.printing = config.get('debug_sql', config.get('debug', False)) self.supports_multiple_insert = False try: import DBUtils # enable pooling if DBUtils module is available. self.has_pooling = True except ImportError: self.has_pooling = False # Pooling can be disabled by passing pooling=False in the keywords. self.has_pooling = self.keywords.pop('pooling', True) and self.has_pooling
def get_ace_version(): """ Get the installed ace version. :return: ace version """ from webapi import config return config.get('webapi', 'ace_version')
def get_fontawesome_version(): """ Get the installed fontawesome version. :return: fontawesome version """ from webapi import config return config.get('webapi', 'fontawesome_version')
def get_jquery_version(): """ Get the installed jquery version. :return: jquery version """ from webapi import config return config.get('webapi', 'jquery_version')
def get_bootstrap_version(): """ Get the installed bootstrap version. :return: bootstrap version """ from webapi import config return config.get('webapi', 'bootstrap_version')
def __init__(self, loc='templates/', cache=None, base=None): if cache is None: cache = not config.get('debug', False) self._loc = loc if cache: self._cache = {} else: self._cache = False self._base = base
def __init__(self, loc='templates/', cache=None, base=None): if cache is None: cache = not config.get('debug', False) self.loc = loc if cache: self.cache = {} else: self.cache = False self.base = base
def __init__(self, loc='templates', cache=None, base=None, **keywords): self._loc = loc self._keywords = keywords if not cache or config.get('debug', False): self._cache = None else: self._cache = {} if base and not hasattr(base, '__call__'): # make base a function, so that it can be passed to sub-renders self._base = lambda page: self._template(base)(page) else: self._base = base
def __init__(self, loc='templates', cache=None, base=None, **keywords): self._loc = loc self._keywords = keywords if cache or config.get('debug', False): self._cache = {} else: self._cache = None if base and not hasattr(base, '__call__'): # make base a function, so that it can be passed to sub-renders self._base = lambda page: self._template(base)(page) else: self._base = base
def __init__(self, loc="templates", cache=None, base=None, **keywords): self._loc = loc self._keywords = keywords if cache is None: cache = not config.get("debug", False) if cache: self._cache = {} else: self._cache = None if base and not hasattr(base, "__call__"): # make base a function, so that it can be passed to sub-renders self._base = lambda page: self._template(base)(page) else: self._base = base
def __init__(self, db_module, keywords): """Creates a database. """ self.db_module = db_module self.keywords = keywords self._ctx = threadeddict() # flag to enable/disable printing queries self.printing = config.get('debug', False) self.supports_multiple_insert = False try: import DBUtils # enable pooling if DBUtils module is available. self.has_pooling = True except ImportError: self.has_pooling = False # Pooling can be disabled by passing pooling=False in the keywords. self.has_pooling = self.keywords.pop('pooling', True) and self.has_pooling