Entry points are a major hassle to deal with during distribution and this really isn't any worse than that. Could probably be automated further but I'd rather have something that works consistently.
69 lines
1.6 KiB
Python
69 lines
1.6 KiB
Python
import sys
|
|
|
|
from cliff.app import App
|
|
from cliff.commandmanager import CommandManager
|
|
|
|
import dcc.concat
|
|
import dcc.configure
|
|
import dcc.dsda
|
|
import dcc.eureka
|
|
import dcc.extract
|
|
import dcc.fabricate
|
|
import dcc.fetch
|
|
import dcc.ls
|
|
import dcc.pb
|
|
import dcc.play
|
|
import dcc.put
|
|
import dcc.record
|
|
import dcc.rib
|
|
import dcc.ss
|
|
import dcc.text
|
|
import dcc.thumb
|
|
|
|
class DCC(App):
|
|
def __init__(self):
|
|
cm = CommandManager(None)
|
|
commands = {
|
|
"concat": dcc.concat.Concat,
|
|
"configure": dcc.configure.Configure,
|
|
"dsda": dcc.dsda.DSDA,
|
|
"eureka": dcc.eureka.Eureka,
|
|
"extract": dcc.extract.Extract,
|
|
"fabricate": dcc.fabricate.Fabricate,
|
|
"fetch": dcc.fetch.Fetch,
|
|
"ls": dcc.ls.List,
|
|
"pb": dcc.pb.PB,
|
|
"play": dcc.play.Play,
|
|
"put": dcc.put.Put,
|
|
"record": dcc.record.Record,
|
|
"rib": dcc.rib.RIB,
|
|
"ss": dcc.ss.SS,
|
|
"text": dcc.text.Text,
|
|
"thumb": dcc.thumb.Thumb,
|
|
}
|
|
for n, c in commands.items():
|
|
cm.add_command(n, c)
|
|
super().__init__(
|
|
description="Doom Command Center",
|
|
version="0.0.1",
|
|
command_manager=cm,
|
|
deferred_help=True,
|
|
)
|
|
|
|
def initialize_app(self, argv):
|
|
pass
|
|
|
|
def prepare_to_run_command(self, cmd):
|
|
pass
|
|
|
|
def clean_up(self, cmd, result, err):
|
|
pass
|
|
|
|
|
|
def main(argv=sys.argv[1:]):
|
|
dcc = DCC()
|
|
return dcc.run(argv)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
sys.exit(main())
|