Skip to content

More info on updating global config for users #208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
more info on global config for users
  • Loading branch information
Alison Wu authored and Alison Wu committed Dec 7, 2024
commit a6ddd5b29340a7f72930488246ada44d605fce24
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:**

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no functionality added. Move this to Fixed


**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

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


Expand Down