How to use the lektor.db.Database function in Lektor

To help you get started, we’ve selected a few Lektor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lektor / lektor / tests / test_unicode.py View on Github external
def get_unicode_builder(tmpdir):
    from lektor.project import Project
    from lektor.environment import Environment
    from lektor.db import Database
    from lektor.builder import Builder

    proj = Project.from_path(os.path.join(os.path.dirname(__file__),
                                          u'ünicöde-project'))
    env = Environment(proj)
    pad = Database(env).new_pad()

    return pad, Builder(pad, str(tmpdir.mkdir('output')))
github lektor / lektor / tests / test_themes.py View on Github external
def theme_pad(theme_env):
    from lektor.db import Database
    return Database(theme_env).new_pad()
github ulope / pyformat.info / vendor / lektor / lektor / devserver.py View on Github external
def build(self, update_source_info_first=False):
        try:
            db = Database(self.env)
            builder = Builder(db.new_pad(), self.output_path,
                              extra_flags=self.extra_flags)
            if update_source_info_first:
                builder.update_all_source_infos()
            builder.build_all()
            if self.prune:
                builder.prune()
        except Exception:
            traceback.print_exc()
        else:
            self.last_build = time.time()
github lektor / lektor / lektor / admin / webui.py View on Github external
def get_pad(self):
        return Database(self.env).new_pad()
github lektor / lektor-archive / lektor / admin / webui.py View on Github external
def get_pad(self):
        return Database(self.env).new_pad()
github lektor / lektor-archive / lektor / devserver.py View on Github external
def build(self, update_source_info_first=False):
        try:
            db = Database(self.env)
            builder = Builder(db.new_pad(), self.output_path,
                              build_flags=self.build_flags)
            if update_source_info_first:
                builder.update_all_source_infos()
            builder.build_all()
            builder.prune()
        except Exception:
            traceback.print_exc()
        else:
            self.last_build = time.time()
github lektor / lektor / lektor / devserver.py View on Github external
def build(self, update_source_info_first=False):
        try:
            db = Database(self.env)
            builder = Builder(db.new_pad(), self.output_path,
                              extra_flags=self.extra_flags)
            if update_source_info_first:
                builder.update_all_source_infos()
            builder.build_all()
            if self.prune:
                builder.prune()
        except Exception:
            traceback.print_exc()
        else:
            self.last_build = time.time()