diff --git a/docker/conf/uwsgi.ini b/docker/conf/uwsgi.ini index fae0077..23a96f6 100644 --- a/docker/conf/uwsgi.ini +++ b/docker/conf/uwsgi.ini @@ -3,5 +3,6 @@ chdir=/project socket=127.0.0.1:8080 master=true vacuum=true +gevent=100 pidfile=/tmp/uwsgi.pid module=project:application diff --git a/mitama/__init__.py b/mitama/__init__.py index d001003..fc54a9a 100755 --- a/mitama/__init__.py +++ b/mitama/__init__.py @@ -11,6 +11,10 @@ import argparse import mitama.commands +import gevent.monkey +#import sqlalchemy_gevent + +gevent.monkey.patch_all() parser = argparse.ArgumentParser(description="Mitama command utilities") subparser = parser.add_subparsers() diff --git a/mitama/app/app.py b/mitama/app/app.py index 92a9b4d..4a801c5 100644 --- a/mitama/app/app.py +++ b/mitama/app/app.py @@ -6,7 +6,6 @@ import magic import markdown from jinja2 import Markup, Environment, ChoiceLoader, FileSystemLoader -from yarl import URL import uuid from mitama.noimage import load_noimage_app diff --git a/mitama/project/commands.py b/mitama/project/commands.py index c63ec1b..2bb901f 100644 --- a/mitama/project/commands.py +++ b/mitama/project/commands.py @@ -24,3 +24,6 @@ def auth(project, args): except Exception: print("Authentication failed") sys.exit(1) + +def uninstall(project, args): + project.uninstall(args.app) diff --git a/mitama/project/project.py b/mitama/project/project.py index 7f9df6f..554c386 100644 --- a/mitama/project/project.py +++ b/mitama/project/project.py @@ -91,8 +91,9 @@ def arg_parser(self): cmd_auth.add_argument("-u", "--user", help="user's screen name", type=str) cmd_auth.add_argument("-p", "--password", help="password", type=str, nargs="?", default="", const="") cmd_auth.set_defaults(handler=commands.auth) - #cmd_cleandb = subparser.add_parser("cleandb", help="Clean up unused App's database") - #cmd_cleandb.add_argument("prefix", help="") + cmd_uninstall = subparser.add_parser("uninstall", help="Uninstall app from project clearly") + cmd_uninstall.add_argument("app", help="app's screen name") + cmd_uninstall.set_defaults(handler=commands.uninstall) return self._arg_parser def command(self): diff --git a/pyproject.toml b/pyproject.toml index efcdfb1..7d2fd15 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,6 @@ Jinja2 = "^2.11.3" SQLAlchemy = "^1.3.23" PyJWT = "^2.0.1" bcrypt = "^3.2.0" -yarl = "^1.6.3" pysaml2 = "^6.5.1" tzlocal = "^2.1" watchdog = "^2.0.1"