예제 #1
0
 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()
예제 #2
0
 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()
예제 #3
0
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()
예제 #4
0
파일: pserve.py 프로젝트: assembl/assembl
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()
예제 #5
0
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()
예제 #6
0
 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()
예제 #7
0
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()
예제 #8
0
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()
예제 #9
0
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()