def inittest(self): b = BlaskApp( templateDir=settings.templateDir, postDir=settings.postDir, defaultLayout=settings.defaultLayout, staticDir=settings.staticDir, title=settings.title, ) b.app.testing = True self.test_client = b.app.test_client()
import argparse import logging from blask import BlaskApp as Blask application = Blask().app if __name__ == '__main__': # Argument parsing parser = argparse.ArgumentParser() parser.add_argument("-d", "--debug", action='store_true', help="Verbose output") parser.add_argument("-v", "--verbose", action='store_true', help="Verbose output") args = parser.parse_args() if args.debug or args.verbose: log = logging.getLogger() level = logging.getLevelName(logging.DEBUG) log.setLevel(level) debug = True else: debug = False application.run(debug=debug)
import argparse import logging from blask import BlaskApp application=BlaskApp().app if __name__ == '__main__': # Argument parsing parser = argparse.ArgumentParser() parser.add_argument( "-d", "--debug", action='store_true', help="Verbose output") parser.add_argument( "-v", "--verbose", action='store_true', help="Verbose output") args = parser.parse_args() if args.debug or args.verbose: log = logging.getLogger() level = logging.getLevelName(logging.DEBUG) log.setLevel(level) debug = True else: debug = False application.run(debug=debug)
def createnotfoundpage(self, filepath): """ Create a new page not found file. :param filepath: file path where the page not found is stored """ shutil.copy(self.not_found, filepath) def createdockerfile(self, filepath="Dockerfile"): """ Create a docker file """ shutil.copy(self.docker_template, filepath) blask = BlaskApp() IS_DEBUG = False cliController = CLIController() @click.group() def blaskcli(): """ Initialice the command Line Interface Objects. """ try: version = get_distribution("blask").version except DistributionNotFound: version = "test_version" click.echo("blask (C) version %s" % version)