feat: add wutta
top-level command with make-uuid
subcommand
i think it only makes sense to have an "opinion" for command line interface in this project, and we probably need more `wutta` subcommands too but we'll see. main motivation for this currently is to allow poser apps to define their own CLI, in particular e.g. `poser install`
This commit is contained in:
parent
cb147c203d
commit
2deba45588
20 changed files with 446 additions and 47 deletions
|
@ -33,7 +33,7 @@ Run that like so:
|
|||
|
||||
|
||||
Better Standards
|
||||
----------------
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
Keeping it simple, but improving that script per recommended patterns::
|
||||
|
||||
|
@ -69,7 +69,7 @@ that this also gives you access to the :term:`app handler`::
|
|||
def hello(config):
|
||||
app = config.get_app()
|
||||
print('hello', config.get('hello.name'))
|
||||
print('from', app.appname)
|
||||
print('from', app.get_title())
|
||||
|
||||
if __name__ == '__main__':
|
||||
config = make_config('my.conf')
|
||||
|
@ -81,7 +81,7 @@ Output should now be different:
|
|||
|
||||
$ python hello.py
|
||||
hello George
|
||||
from wutta
|
||||
from WuttJamaican
|
||||
|
||||
You are likely to need more imports; it is generally wise to do those
|
||||
*within the function* as opposed to the top of the module. This is to
|
||||
|
@ -97,7 +97,7 @@ before all packages are imported::
|
|||
|
||||
app = config.get_app()
|
||||
print('hello', config.get('hello.name'))
|
||||
print('from', app.appname)
|
||||
print('from', app.get_title())
|
||||
|
||||
something(config)
|
||||
|
||||
|
@ -143,7 +143,7 @@ Here is the script with logging incorporated::
|
|||
log.debug("saying hello")
|
||||
app = config.get_app()
|
||||
print('hello', config.get('hello.name'))
|
||||
print('from', app.appname)
|
||||
print('from', app.get_title())
|
||||
|
||||
log.debug("about to do something")
|
||||
if something(config):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue