@@ -24,30 +24,44 @@ Using the tools module, we can efficiently get them in terms of a dictionary.
2424
2525 The function returns a dictionary containing the username and email information.
2626
27- 2) You can also override existing values by passing a dictionary to the function with the keys ``"username" `` and ``"email" `` ::
27+ 2) There are a few ways you could use to override the user information in the configuration files
28+ * You can override existing values by passing a dictionary to the function with the keys ``"username" `` and ``"email" `` ::
2829
29- new_args = {"username": "new_username", "email": "new@example.com"}
30- new_user_info = get_user_info(new_args)
30+ new_args = {"username": "new_username", "email": "new@example.com"}
31+ new_user_info = get_user_info(new_args)
3132
32- 3) You can update only the username or email individually, for example ::
33+ This returns "new_username" and "new@example.com" instead of the
34+ * You can update only the username or email individually, for example ::
3335
34- new_username = {"username": new_username}
35- new_user_info = get_user_info(new_username)
36+ new_username = {"username": new_username}
37+ new_user_info = get_user_info(new_username)
3638
37- This updates username to "new_username" while fetching the email from inputs or the configuration files.
38- Similarly, you can update only the email. ::
39+ This updates username to "new_username" while fetching the email from inputs or the configuration files.
40+ Similarly, you can update only the email. ::
3941
40- new_email = {"email": new@email.com}
41- new_user_info = get_user_info(new_email)
42+ new_email = {"email": new@email.com}
43+ new_user_info = get_user_info(new_email)
4244
43- This updates the email to "new@email.com" while fetching the username from inputs or the configuration files.
45+ This updates the email to "new@email.com" while fetching the username from inputs or the configuration files.
46+
47+ 3) You can also permanently update your default configuration file manually.
48+ Locate the file ``diffpyconfig.json ``, which is usually in the user's home directory (``~/.diffpy/ ``) or ``~/.config/diffpy/ ``.
49+ Open the file using a text editor such as nano, vim, or a graphical editor like VS Code.
50+ Look for entries like these ::
51+
52+ {
53+ "username": "John Doe",
54+ "email": "john.doe@example.com"
55+ }
56+
57+ Then you can update the username and email as needed, make sure to save your edits.
4458
45594) We also have the function ``get_package_info ``, which inserts or updates package names and versions
4660 in the given metadata dictionary under the key "package_info".
4761 It stores the package information as {"package_info": {"package_name": "version_number"}}.
4862 This function can be used as follows. ::
4963
50- from diffpy.utils.tools import get_user_info
64+ from diffpy.utils.tools import get_package_info
5165 package_metadata = get_package_info("my_package")
5266
5367 You can also specify an existing dictionary to be updated with the information. ::
0 commit comments