-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpoetool.py
39 lines (31 loc) · 1003 Bytes
/
poetool.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
import sys
import argparse
from nubia import Nubia, PluginInterface, Options
import tool.cli.commands
from tool.cli.statusbar import PoEToolStatusBar
class POECLI(Nubia):
def _parse_args(self, cli_args=sys.argv):
args = super()._parse_args(cli_args)
setattr(args, "verbose", True)
setattr(args, "stderr", True)
return args
class POEToolPlugin(PluginInterface):
def get_opts_parser(self, add_help=True):
opts_parser = argparse.ArgumentParser(
description="PoE data tool",
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
add_help=add_help,
)
return opts_parser
def get_status_bar(self, context):
return PoEToolStatusBar(context)
def main():
shell = POECLI(
name="poe_tool",
command_pkgs=tool.cli.commands,
plugin=POEToolPlugin(),
options=Options(persistent_history=True),
)
sys.exit(shell.run())
if __name__ == "__main__":
main()