Browse Source

main.py: launch(): make params keyword-only

The MMGen Project 11 months ago
parent
commit
5522ffb169

+ 1 - 1
cmds/mmgen-addrgen

@@ -22,4 +22,4 @@ mmgen-addrgen: Generate a series or range of addresses from an MMGen
 """
 """
 
 
 from mmgen.main import launch
 from mmgen.main import launch
-launch("addrgen")
+launch(mod='addrgen')

+ 1 - 1
cmds/mmgen-addrimport

@@ -21,4 +21,4 @@ mmgen-addrimport: Import addresses into a MMGen bitcoind watching wallet
 """
 """
 
 
 from mmgen.main import launch
 from mmgen.main import launch
-launch("addrimport")
+launch(mod='addrimport')

+ 1 - 1
cmds/mmgen-autosign

@@ -21,4 +21,4 @@ mmgen-autosign: Auto-sign MMGen transactions
 """
 """
 
 
 from mmgen.main import launch
 from mmgen.main import launch
-launch("autosign")
+launch(mod='autosign')

+ 1 - 1
cmds/mmgen-keygen

@@ -22,4 +22,4 @@ mmgen-keygen: Generate a series or range of keys from an MMGen deterministic
 """
 """
 
 
 from mmgen.main import launch
 from mmgen.main import launch
-launch("keygen")
+launch(mod='addrgen')

+ 1 - 1
cmds/mmgen-msg

@@ -13,4 +13,4 @@ mmgen-msg: Message signing operations for the MMGen suite
 """
 """
 
 
 from mmgen.main import launch
 from mmgen.main import launch
-launch("msg")
+launch(mod='msg')

+ 1 - 1
cmds/mmgen-passchg

@@ -22,4 +22,4 @@ mmgen-passchg: Change an MMGen deterministic wallet's passphrase, label or
 """
 """
 
 
 from mmgen.main import launch
 from mmgen.main import launch
-launch("passchg")
+launch(mod='wallet')

+ 1 - 1
cmds/mmgen-passgen

@@ -22,4 +22,4 @@ mmgen-passgen: Generate a range or series of passwords from an MMGen
 """
 """
 
 
 from mmgen.main import launch
 from mmgen.main import launch
-launch("passgen")
+launch(mod='passgen')

+ 1 - 1
cmds/mmgen-regtest

@@ -22,4 +22,4 @@ mmgen-regtest: Bitcoind regression test mode setup and operations for the MMGen
 """
 """
 
 
 from mmgen.main import launch
 from mmgen.main import launch
-launch("regtest")
+launch(mod='regtest')

+ 1 - 1
cmds/mmgen-seedjoin

@@ -21,4 +21,4 @@ mmgen-seedjoin: Recreate an MMGen deterministic wallet from its component shares
 """
 """
 
 
 from mmgen.main import launch
 from mmgen.main import launch
-launch("seedjoin")
+launch(mod='seedjoin')

+ 1 - 1
cmds/mmgen-seedsplit

@@ -21,4 +21,4 @@ mmgen-seedsplit: Generate a seed split from an MMGen deterministic wallet
 """
 """
 
 
 from mmgen.main import launch
 from mmgen.main import launch
-launch("seedsplit")
+launch(mod='wallet')

+ 1 - 1
cmds/mmgen-subwalletgen

@@ -21,4 +21,4 @@ mmgen-subwalletgen: Generate a subwallet from an MMGen deterministic wallet
 """
 """
 
 
 from mmgen.main import launch
 from mmgen.main import launch
-launch("subwalletgen")
+launch(mod='wallet')

+ 1 - 1
cmds/mmgen-tool

@@ -22,4 +22,4 @@ mmgen-tool:  Perform various Bitcoin-related operations.
 """
 """
 
 
 from mmgen.main import launch
 from mmgen.main import launch
-launch("tool")
+launch(mod='tool')

+ 1 - 1
cmds/mmgen-txbump

@@ -22,4 +22,4 @@ optionally sign and send it.
 """
 """
 
 
 from mmgen.main import launch
 from mmgen.main import launch
-launch("txbump")
+launch(mod='txbump')

+ 1 - 1
cmds/mmgen-txcreate

@@ -22,4 +22,4 @@ mmgen-txcreate: Create a Bitcoin transaction from MMGen- or non-MMGen inputs
 """
 """
 
 
 from mmgen.main import launch
 from mmgen.main import launch
-launch("txcreate")
+launch(mod='txcreate')

+ 1 - 1
cmds/mmgen-txdo

@@ -21,4 +21,4 @@ mmgen-txdo: Create, sign and broadcast an online MMGen transaction
 """
 """
 
 
 from mmgen.main import launch
 from mmgen.main import launch
-launch("txdo")
+launch(mod='txdo')

+ 1 - 1
cmds/mmgen-txsend

@@ -21,4 +21,4 @@ mmgen-txsend: Broadcast a transaction signed by 'mmgen-txsign' to the network
 """
 """
 
 
 from mmgen.main import launch
 from mmgen.main import launch
-launch("txsend")
+launch(mod='txsend')

+ 1 - 1
cmds/mmgen-txsign

@@ -21,4 +21,4 @@ mmgen-txsign: Sign a transaction generated by 'mmgen-txcreate'
 """
 """
 
 
 from mmgen.main import launch
 from mmgen.main import launch
-launch("txsign")
+launch(mod='txsign')

+ 1 - 1
cmds/mmgen-walletchk

@@ -21,4 +21,4 @@ mmgen-walletchk: Check integrity of an MMGen deterministic wallet
 """
 """
 
 
 from mmgen.main import launch
 from mmgen.main import launch
-launch("walletchk")
+launch(mod='wallet')

+ 1 - 1
cmds/mmgen-walletconv

@@ -22,4 +22,4 @@ mmgen-walletconv: Convert an MMGen deterministic wallet from one format
 """
 """
 
 
 from mmgen.main import launch
 from mmgen.main import launch
-launch("walletconv")
+launch(mod='wallet')

+ 1 - 1
cmds/mmgen-walletgen

@@ -21,4 +21,4 @@ mmgen-walletgen: Generate an MMGen deterministic wallet
 """
 """
 
 
 from mmgen.main import launch
 from mmgen.main import launch
-launch("walletgen")
+launch(mod='wallet')

+ 1 - 1
cmds/mmgen-xmrwallet

@@ -21,4 +21,4 @@ mmgen-xmrwallet: Monero wallet ops for the MMGen suite
 """
 """
 
 
 from mmgen.main import launch
 from mmgen.main import launch
-launch("xmrwallet")
+launch(mod='xmrwallet')

+ 1 - 7
mmgen/main.py

@@ -22,13 +22,7 @@ main: Script launcher for the MMGen Project
 
 
 import sys,os
 import sys,os
 
 
-def launch(mod,package='mmgen'):
-
-	if mod in ('walletgen','walletchk','walletconv','passchg','subwalletgen','seedsplit'):
-		mod = 'wallet'
-
-	if mod == 'keygen':
-		mod = 'addrgen'
+def launch(*, mod=None, package='mmgen'):
 
 
 	if sys.platform == 'linux' and sys.stdin.isatty():
 	if sys.platform == 'linux' and sys.stdin.isatty():
 		import termios,atexit
 		import termios,atexit