Commit graph

103 commits

Author SHA1 Message Date
ab41b78863
new platform global constant 2026-05-17 18:03:32 +00:00
f840069ecb
update copyright dates 2026-02-11 13:02:12 +00:00
fa2b2e5cd0
led.py: reimplement binfo as dataclass 2025-09-29 23:09:17 +00:00
4573e170ed
test suite: use match statement where practicable (21 files) 2025-09-23 09:20:53 +00:00
e41249aa04
LEDControl.binfo: add color attribute 2025-09-09 11:27:04 +00:00
abdb00f49f
Config: set opts_data['sets'] options after env and cfgfile 2025-05-26 09:39:11 +00:00
c452db345c
ui.keypress_confirm(): add do_exit, exit_msg params 2025-03-25 09:46:01 +00:00
e54f039690
update copyright dates 2025-02-16 14:42:27 +00:00
f8a312e407
coin-specific and protocol-specific configuration options
Rationale: to enable communication with multiple coin daemons on multiple hosts
in a single program invocation, making possible the implementation of asset
swap functionality, for instance

Coin-specific options are prefixed with a coin symbol, proto-specific options
with a coin symbol plus a network name.

Coin- and protocol-specific options override their non-prefixed counterparts.
They are available via the command line, configuration file and Config API.

Currently available options:

    Option                   Supported Prefixes
    tw_name                  btc ltc bch
    rpc_user                 btc ltc bch
    rpc_password             btc ltc bch
    rpc_host                 btc ltc bch eth etc
    rpc_port                 btc ltc bch eth etc xmr
    ignore_daemon_version    btc ltc bch eth etc xmr
    max_tx_fee               btc ltc bch eth etc
    chain_names              eth_mainnet eth_testnet etc_mainnet etc_testnet

Example:

    $ mmgen-tool --coin=ltc --ltc-tw-name=ltc2 --ltc-ignore-daemon-version twview

Help:

    $ mmgen-tool --longhelp
    $ view mmgen/data/mmgen.cfg

Testing:

    $ test/daemontest.py rpc.btc rpc.geth
    $ test/cmdtest.py help opts cfgfile
2025-01-27 16:01:53 +00:00
941bbdc4b5
minor cleanups, whitespace 2025-01-27 16:01:53 +00:00
46381def86
cmdtest.py opts: cleanups 2025-01-27 16:01:53 +00:00
7131b892e3
minor fixes and cleanups 2025-01-27 16:01:48 +00:00
fb17a3b2c9
led.py: improve initialization logic, add interactive test 2025-01-21 09:36:14 +00:00
487678bce9
Use Ruff static code analyzer for Github workflows 2024-12-30 13:59:03 +00:00
df3559d420
support negated command-line options
- all options without parameters may be negated by prefixing the option name
  with ‘no-’
- if the option name itself begins with ‘no-’, then the option is negated
  by removing the ‘no-’ prefix
- negation may be used to override options set in the cfg file
- command-line options may also be overridden, with the last-listed option
  taking precedence
- as with ordinary options, substring matching is supported

Examples:

    OPTION        NEGATED OPTION
    --no-license  --license
    --no-license  --lic
    --quiet       --no-quiet
    --quiet       --no-q

Testing:

    $ test/cmdtest.py opts cfgfile
2024-10-20 10:19:02 +00:00
34deadb0f5
test suite cfgfile: cleanups 2024-10-20 10:16:23 +00:00
f9e6d994f0
whitespace: test/misc 2024-10-18 10:32:13 +00:00
5150ca586b
update file header 2024-10-18 10:32:06 +00:00
6e728b7f4d
opts: allow combined short option with parameter; add tests
`foo -abparam`, equivalent to `foo -a -bparam`, is now allowed, in conformity
with standard Unix option parsing convention.
2024-10-10 11:28:51 +00:00
d7e3b55e3b
opts, help: refactor, parse cmdline opts natively, filter global opts
- command-line options are now parsed natively, without use of the getopt module
- global options and --longhelp helpscreen are now contextual, depending on coin
  and executed command
- commands invoked with out-of-context global options (e.g. `mmgen-walletgen
  --coin=btc`) now fail with an ‘unrecognized option’ error

Testing:

    $ test/test-release.sh help
    $ test/cmdtest.py opts
2024-10-08 12:56:02 +00:00
66521a07f2
update --longhelp text 2024-10-08 12:55:58 +00:00
91991a13de
support macOS (BTC-only, no autosign)
Testing:

    $ test/test-release.sh -FCSTA

Tested on macOS 13.6.7 (Ventura) + Xcode 15.0.1
2024-07-27 10:01:05 +00:00
a0eb2871f9
minor fixes and cleanups throughout 2024-07-27 09:56:20 +00:00
e75169f258
new file: test/misc/cfg.py 2024-03-09 11:33:26 +00:00
c815cf4dd6
renamed: test/misc/cfg.py -> test/misc/cfg_main.py 2024-03-09 11:33:26 +00:00
5c419c802b
main.py: add fqmod param; add test/misc/opts.py launcher 2024-03-08 14:13:23 +00:00
211b71431d
renamed: test/misc/opts.py -> test/misc/opts_main.py 2024-03-08 14:13:23 +00:00
8e46932475
update copyright dates 2024-01-19 11:05:10 +00:00
ed01582dff
rename repository: mmgen -> mmgen-wallet 2023-11-17 09:04:14 +00:00
0a1e3c3c98
pylint integration: gc.platform -> sys.platform 2023-10-13 09:51:12 +00:00
7e8f3ab7b5
pylint (test suite) - bugfixes 2023-10-11 12:58:53 +00:00
a0fe92f832
pylint (test suite) - non-interpolated f-strings 2023-10-11 12:58:52 +00:00
9a8f6216f7
pylint (test suite) - f-strings 2023-10-11 12:58:52 +00:00
7b32c412d5
pylint (test suite) - imports 2023-10-11 12:58:51 +00:00
aff850d1c8
test suite: import cleanups 2023-10-03 14:27:57 +00:00
29ebec09c3
minor testing fixes 2023-06-13 18:32:20 +00:00
46dcb5cabe
minor fixes and cleanups 2023-05-19 16:16:52 +00:00
286105b73a
opts.py: remove show_common_opts_diff() 2023-04-04 16:04:11 +00:00
d81d82fe35
cfg.py: prefix internally used attrs with underscore 2023-04-04 16:04:11 +00:00
9e1935ad19
opts.init() -> Config() 2023-04-04 16:04:10 +00:00
3896293652
minor cleanups 2023-04-04 16:04:10 +00:00
c7adb56e38
Config API, Part I
This patch eliminates the global configuration variables `opt` and `g`, making
all functions and class instances locally configurable.  Configuration data is
passed to functions and constructors via the `cfg` parameter and made available
to methods in `self.cfg`.

Local configuration free from dependence on the command line will enable the
creation of multiple, independently configured instances of MMGen’s data
objects within a single process.

Potential applications include testing (tracking wallets configured to interact
with spawned processes, for example) and the use of MMGen as a library for
other projects.

This patch completes most of the work required to enable the API.  The full
implementation will appear in a forthcoming commit.
2023-03-28 18:14:37 +00:00
c3ce1ab8e3
globalvars.py: new GlobalConstants (gc), GlobalVars (gv) classes
- The attributes of GlobalConstants are non-configurable.  They’re constant
  for a given machine, user, executable and MMGen release.

- The attributes of GlobalVars, `stderr` and `stdout`, are used by the test
  suite to redirect msg() and friends to /dev/null.

- All the aforementioned attributes formerly belonged to GlobalConfig.
2023-03-28 18:14:36 +00:00
19f0730913
crypto.py: reimplement as class 2023-03-27 10:50:38 +00:00
795b653c6d
cfgfile.py: cleanups 2023-03-27 10:50:38 +00:00
9eab15dc6e
mn_entry.py: check configured mnemonic entry modes at runtime 2023-03-27 10:50:37 +00:00
78e882143c
whitespace, cleanups, imports throughout [73 files changed] 2023-03-27 10:49:04 +00:00
fcb520228d
cfgfile.py: cleanups, avoid use of g.data_dir_root 2023-03-27 10:48:19 +00:00
80244b57ea
module rename: cfg.py -> cfgfile.py 2023-03-27 10:48:19 +00:00
29e6822bd1
fix setting of autoset opts in cfg file 2023-01-03 10:36:08 +00:00