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.testClient = b.app.test_client()
import argparse import logging from Blask import BlaskApp 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 BlaskApp().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)
Create a new settings file """ shutil.copy(self.settings, '.env') 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): shutil.copy(self.docker_template, filepath) blask = BlaskApp() isdebug = 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)
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)