-
Notifications
You must be signed in to change notification settings - Fork 5
/
main.py
executable file
·58 lines (45 loc) · 1.4 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env python3.9
# -*- coding: utf-8 -*-
# @Author: lnorb.com
# @Date: 2022-07-14 18:22:27
# @Last Modified by: lnorb.com
# @Last Modified time: 2022-09-05 14:15:01
import os
import sys
from pathlib import Path
os.environ["KIVY_NO_ARGS"] = "1"
parent_dir = Path(__file__).parent
for p in (parent_dir / Path("third_party")).glob("*"):
sys.path.append(p.as_posix())
if len(sys.argv) == 1:
import kivy
kivy.require("2.1.0")
from orb.orb_main import main
from orb.core_ui.hidden_imports import *
main()
elif len(sys.argv) == 2 and sys.argv[-1].endswith(".py"):
from importlib import __import__
__import__(sys.argv[-1].split(".")[0])
else:
import typer
from orb.cli import node
from orb.cli import invoice
from orb.cli import peer
from orb.cli import pay
from orb.cli import channel
from orb.cli import test
from orb.cli import chain
from orb.cli import web
from orb.cli import network
app = typer.Typer()
app.add_typer(node.app, name="node")
app.add_typer(invoice.app, name="invoice")
app.add_typer(pay.app, name="pay")
app.add_typer(channel.app, name="channel")
app.add_typer(test.app, name="test")
app.add_typer(peer.app, name="peer")
app.add_typer(chain.app, name="chain")
app.add_typer(web.app, name="web")
app.add_typer(network.app, name="network")
if __name__ == "__main__":
app()