def _run(self): # pserve wants a file to open, so use the *composed* config. with tempfile.NamedTemporaryFile(mode="w") as config_file: self.config.write(config_file) config_file.flush() argv = ["mishmish", config_file.name] pserve = PServeCommand(argv) return pserve.run()
def _run(self): # pserve wants a file to open, so use the composed config. with tempfile.NamedTemporaryFile(mode="w", suffix=".ini") as config_file: self.config.write(config_file) config_file.flush() pserve = PServeCommand(["mishmish", config_file.name]) return pserve.run()
def main(argv=None, quiet=False): """Runs original pserve with .env support.""" if not argv: argv = sys.argv load_dotenv_vars() command = PServeCommand(argv, quiet=quiet) return command.run()
def main(argv=sys.argv, quiet=False): command = PServeCommand(argv, quiet) try: os.environ["NODE_ENV"] = "development" return command.run() except Exception: traceback.print_exc() import pdb; pdb.post_mortem()
def main(argv=sys.argv, quiet=False): command = PServeCommand(argv, quiet) try: os.environ["NODE_ENV"] = "development" return command.run() except Exception: import pdb pdb.post_mortem()
def main(argv=None, quiet=False): # `pserve` (PServeCommand) needs `hupper`, `hupper` has dependency # **fcntl**. In some environment (e.g. app engine), fcntl is not found :'( from pyramid.scripts.pserve import PServeCommand if not argv: argv = sys.argv Env.load_dotenv_vars() command = PServeCommand(argv, quiet=quiet) return command.run()
def main(argv=None, quiet=False): """Runs original pserve with .env support.""" # NOTE: # `pserve` (PServeCommand) needs `hupper`, it has dependency to **fcntl**. # In some environment (e.g. appengine), fcntl is not found :'( # So, that's why this import is in method. from pyramid.scripts.pserve import PServeCommand if not argv: argv = sys.argv load_dotenv_vars() command = PServeCommand(argv, quiet=quiet) return command.run()
import os from pyramid.scripts.pserve import PServeCommand ini_file = os.path.join(os.path.dirname(__file__), '..', 'etc', 'local.ini') PServeCommand(['pserve', ini_file]).run()