Skip to content

Commit

Permalink
Merge pull request diffpy#208 from alisnwu/config-UX
Browse files Browse the repository at this point in the history
More info on updating global config for users
  • Loading branch information
sbillinge authored Dec 8, 2024
2 parents 77b884c + 74a740a commit 77c0b9e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
23 changes: 23 additions & 0 deletions news/config-UX.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* additional information to users to relieve frustration in finding how to update global config

**Security:**

* <news item>
5 changes: 5 additions & 0 deletions src/diffpy/utils/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ 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


Expand Down

0 comments on commit 77c0b9e

Please sign in to comment.