コード例 #1
0
ファイル: gfl_run.py プロジェクト: malanore-z/GFL_fork
import sys

from gfl.conf import GflConf
from gfl.application import Application
from gfl.shell import Shell

GflConf.home_dir = "data"
GflConf.load()

if __name__ == "__main__":
    sys.stderr = open("std.err", "w")
    console = True
    role = "server"

    Shell.welcome()
    Application.run(role, console)
    sys.stderr.close()
コード例 #2
0
def detect_homedir(args_home):

    if args_home is not None:
        return args_home
    env = os.getenv("GFL_HOME")
    if env is not None:
        return env
    return GflConf.home_dir


if __name__ == "__main__":
    args = parser.parse_args()
    GflConf.home_dir = detect_homedir(args.home)

    if args.action == "attach":
        Shell.attach(args.host, args.port)
    else:
        GflConf.load()
        Shell.welcome()
        if args.action == "init":
            Application.init(args.force)
        elif args.action == "run":
            props = {}
            if args.props:
                for p in args.props:
                    kv = p.split("=")
                    props[kv[0]] = kv[1]
            Application.run(role=args.role, console=args.console, **props)
        else:
            print("unknown action.")
コード例 #3
0
ファイル: main.py プロジェクト: yiye93/GFL_fork
from gfl.application import Application
from gfl.conf import GflConf


if __name__ == "__main__":
    GflConf.home_dir = "data"
    Application.run(daemon=False)
コード例 #4
0
ファイル: server_action.py プロジェクト: yiye93/GFL_fork
def server(args):
    if args.home is not None:
        GflConf.home_dir = args.home
    Application.run(role="server", daemon=args.d)
コード例 #5
0
import os

from gfl.application import Application
from gfl.conf import GflConf

GflConf.home_dir = os.path.join(os.path.dirname(__file__), "../data")

if __name__ == "__main__":
    Application.run(True)
コード例 #6
0
ファイル: client_action.py プロジェクト: yiye93/GFL_fork
def client(args):
    if args.home is not None:
        GflConf.home_dir = args.home
    Application.run(role="client")
コード例 #7
0
from gfl.conf import GflConf
from gfl.application import Application
from gfl.shell import Shell

GflConf.home_dir = "data"
GflConf.load()

if __name__ == "__main__":
    Shell.welcome()
    Application.init(True)