Commit graph

21 commits

Author SHA1 Message Date
f9e6d994f0
whitespace: test/misc 2024-10-18 10:32:13 +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
aff850d1c8
test suite: import cleanups 2023-10-03 14:27:57 +00:00
9e1935ad19
opts.init() -> Config() 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
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
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
59bffb59b2
CoinProtocol.Base: skip loading of .amt module via 'need_amt=False' 2022-01-29 11:25:03 +00:00
53145cbc9f
test.py: minor fixes 2021-10-10 20:18:16 +00:00
ea5eedcff3
minor changes, whitespace 2021-10-02 17:54:11 +00:00
6692a43d59
f-strings, whitespace (test files) [44 files patched] 2021-09-29 21:17:57 +00:00
44ace41c79
cfg.py: add 'mnemonic_entry_modes' test 2021-07-29 14:30:22 +00:00
9862f4c5a6
cfg.py: improve cfg file parsing
- Parsing is now more strict, requiring a value to exist for each option, so
  existing config files may generate errors.  If a sample file generates a
  parse error upon script launch, delete the file and restart the script.
2021-07-29 14:22:00 +00:00
bab1242817
minor fixes and cleanups 2021-07-29 14:20:44 +00:00
e10f5d19ac
protocol-specific cfg_file vars: fix chain_name parsing regression, add test 2021-03-12 14:52:58 +00:00
17ce9e54b5
opts.py: minor cleanups 2020-05-16 12:01:04 +00:00
924ccc6012
new CfgFile API for mmgen.cfg and related files
Testing:

  $ test/test.py cfg
2020-03-12 17:01:47 +00:00