From a6ddd5b29340a7f72930488246ada44d605fce24 Mon Sep 17 00:00:00 2001 From: Alison Wu Date: Sat, 7 Dec 2024 17:56:29 -0500 Subject: [PATCH 1/3] more info on global config for users --- news/config-UX.rst | 23 +++++++++++++++++++++++ src/diffpy/utils/tools.py | 4 ++++ 2 files changed, 27 insertions(+) create mode 100644 news/config-UX.rst diff --git a/news/config-UX.rst b/news/config-UX.rst new file mode 100644 index 00000000..05f66a10 --- /dev/null +++ b/news/config-UX.rst @@ -0,0 +1,23 @@ +**Added:** + +* additional information to users to relieve frustration in finding how to update global config + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/src/diffpy/utils/tools.py b/src/diffpy/utils/tools.py index 82cca8c9..728d8601 100644 --- a/src/diffpy/utils/tools.py +++ b/src/diffpy/utils/tools.py @@ -83,6 +83,10 @@ def _create_global_config(args): return_bool = False if username is None or email is None else True with open(Path().home() / "diffpyconfig.json", "w") as f: f.write(json.dumps({"username": stringify(username), "email": stringify(email)})) + print( + f"You can manually edit the config file at {Path().home() / 'diffpyconfig.json'} using any text editor.\n" + f"Or you can update the config file by passing new values to get_user_info(), " + f"see examples here: https://www.diffpy.org/diffpy.utils/examples/toolsexample.html") return return_bool From 15d14f520597a195910aec5ea09c6ebd7109348a Mon Sep 17 00:00:00 2001 From: Alison Wu Date: Sat, 7 Dec 2024 17:58:19 -0500 Subject: [PATCH 2/3] pre-commit fix --- src/diffpy/utils/tools.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/diffpy/utils/tools.py b/src/diffpy/utils/tools.py index 728d8601..7e5e858f 100644 --- a/src/diffpy/utils/tools.py +++ b/src/diffpy/utils/tools.py @@ -86,7 +86,8 @@ def _create_global_config(args): print( f"You can manually edit the config file at {Path().home() / 'diffpyconfig.json'} using any text editor.\n" f"Or you can update the config file by passing new values to get_user_info(), " - f"see examples here: https://www.diffpy.org/diffpy.utils/examples/toolsexample.html") + f"see examples here: https://www.diffpy.org/diffpy.utils/examples/toolsexample.html" + ) return return_bool From 74a740ac8876fbb46c011f3587e30cd2ed111e35 Mon Sep 17 00:00:00 2001 From: Alison Wu Date: Sun, 8 Dec 2024 14:25:14 -0500 Subject: [PATCH 3/3] fixed news item --- news/config-UX.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/news/config-UX.rst b/news/config-UX.rst index 05f66a10..af826723 100644 --- a/news/config-UX.rst +++ b/news/config-UX.rst @@ -1,6 +1,6 @@ **Added:** -* additional information to users to relieve frustration in finding how to update global config +* **Changed:** @@ -16,7 +16,7 @@ **Fixed:** -* +* additional information to users to relieve frustration in finding how to update global config **Security:**