@@ -41,7 +41,7 @@ The function will return
4141
4242.. code-block :: python
4343
44- { " owner_email " : " [email protected] " , " owner_name " : " Jane Doe " , " owner_orcid" : " 0000-0000-0000-0000" } 44+ { " owner_name " : " Jane Doe " , " owner_email " : " [email protected] " , " owner_orcid" : " 0000-0000-0000-0000" } 4545
4646
4747 Where does ``get_user_info() `` get the user information from?
@@ -77,6 +77,7 @@ When building an application where you want to capture data-owner information, w
7777``check_and_build_global_config() `` first followed by ``get_user_info `` in your app workflow. E.g.,
7878
7979.. code-block :: python
80+
8081 from diffpy.utils.tools import check_and_build_global_config, get_user_info
8182 from datetime import datetime
8283 import json
@@ -95,6 +96,24 @@ it will only run once. However, if you want to bypass this behavior,
9596``check_and_build_global_config() `` takes an optional boolean ``skip_config_creation `` parameter that
9697could be set to ``True `` at runtime to override the config creation.
9798
99+ What happens when you run ``check_and_build_global_config() ``?
100+ --------------------------------------------------------------
101+
102+ When you set ``skip_config_creation `` to ``False `` and there is no existing global configuration file,
103+ the function will prompt you for inputs (name, email, ORCID).
104+ An example of the prompts you may see is:
105+
106+ .. code-block :: python
107+
108+ Please enter the name you would want future work to be credited to: Jane Doe
109+ Please enter your email: janedoe@ example.com
110+ Please enter your orcid ID if you know it: 0000 - 0000 - 0000 - 0000
111+
112+
113+ After receiving the inputs, the function will write the information to
114+ the `diffpyconfig.json ` file in your home directory.
115+
116+
98117``check_and_build_global_config() `` returns ``True `` if the config file exists (whether it created it or not)
99118and ``False `` if the config file does not exist in the user's home allowing you to develop your own
100119workflow for handling missing config files after running it with ``skip_config_creation=True ``.
@@ -104,7 +123,7 @@ I entered the wrong information in my config file so it always loads incorrect i
104123
105124It is easy to fix this simply by deleting the global and/or local config files, which will allow
106125you to re-enter the information during the ``check_and_build_global_config() `` initialization
107- workflow. You can also simply editi the ``diffpyconfig.json `` file directly using a text
126+ workflow. You can also simply edit the ``diffpyconfig.json `` file directly using a text
108127editor.
109128
110129Locate the file ``diffpyconfig.json ``, in your home directory and open it in an editor ::
@@ -115,7 +134,7 @@ Locate the file ``diffpyconfig.json``, in your home directory and open it in an
115134 "owner_orcid": "0000-0000-4321-1234"
116135 }
117136
118- Then you can edit the username and email as needed, make sure to save your edits.
137+ Then you can edit the username and email as needed, make sure to save your edits.
119138
120139Automatically Capture Info about a Software Package Being Used
121140==============================================================
0 commit comments