Skip to content

Commit 634205c

Browse files
committed
fix init_config to always run
1 parent 4adf841 commit 634205c

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

mhi/main.py

+7-8
Original file line numberDiff line numberDiff line change
@@ -1083,8 +1083,15 @@ def _dispatch(args):
10831083
config.write()
10841084
state.write()
10851085

1086+
def init_config():
1087+
global config, state
1088+
cfgdir = os.environ.get('HOME', '')
1089+
config = ConfigObj(infile=f"{cfgdir}/.mhirc", create_empty=True)
1090+
state = ConfigObj(infile=f"{cfgdir}/.mhistate", create_empty=True)
1091+
10861092

10871093
def _cmd_dispatch(args):
1094+
init_config()
10881095
try:
10891096
_dispatch(args)
10901097
except KeyboardInterrupt:
@@ -1097,14 +1104,6 @@ def cmd_main():
10971104
_cmd_dispatch(['mhi', cmd] + sys.argv[1:])
10981105

10991106

1100-
def init_config():
1101-
global config, state
1102-
cfgdir = os.environ.get('HOME', '')
1103-
config = ConfigObj(infile=f"{cfgdir}/.mhirc", create_empty=True)
1104-
state = ConfigObj(infile=f"{cfgdir}/.mhistate", create_empty=True)
1105-
1106-
11071107
def main():
1108-
init_config()
11091108
# main program
11101109
_cmd_dispatch(sys.argv)

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "mhi"
3-
version = "0.8.5"
3+
version = "0.8.6"
44
requires-python = ">=3.8"
55
description = "MH for IMAP"
66
readme = "README.md"

0 commit comments

Comments
 (0)