diff --git a/mhi/main.py b/mhi/main.py index bf9689b..a13b365 100755 --- a/mhi/main.py +++ b/mhi/main.py @@ -1083,8 +1083,15 @@ def _dispatch(args): config.write() state.write() +def init_config(): + global config, state + cfgdir = os.environ.get('HOME', '') + config = ConfigObj(infile=f"{cfgdir}/.mhirc", create_empty=True) + state = ConfigObj(infile=f"{cfgdir}/.mhistate", create_empty=True) + def _cmd_dispatch(args): + init_config() try: _dispatch(args) except KeyboardInterrupt: @@ -1097,14 +1104,6 @@ def cmd_main(): _cmd_dispatch(['mhi', cmd] + sys.argv[1:]) -def init_config(): - global config, state - cfgdir = os.environ.get('HOME', '') - config = ConfigObj(infile=f"{cfgdir}/.mhirc", create_empty=True) - state = ConfigObj(infile=f"{cfgdir}/.mhistate", create_empty=True) - - def main(): - init_config() # main program _cmd_dispatch(sys.argv) diff --git a/pyproject.toml b/pyproject.toml index ec8115a..2467b23 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "mhi" -version = "0.8.5" +version = "0.8.6" requires-python = ">=3.8" description = "MH for IMAP" readme = "README.md"