@@ -41,7 +41,7 @@ The function will return
41
41
42
42
.. code-block :: python
43
43
44
- { " owner_email " : " janedoe@email.com " , " owner_name " : " Jane Doe " , " owner_orcid" : " 0000-0000-0000-0000" }
44
+ { " owner_name " : " Jane Doe " , " owner_email " : " janedoe@email.com " , " owner_orcid" : " 0000-0000-0000-0000" }
45
45
46
46
47
47
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
77
77
``check_and_build_global_config() `` first followed by ``get_user_info `` in your app workflow. E.g.,
78
78
79
79
.. code-block :: python
80
+
80
81
from diffpy.utils.tools import check_and_build_global_config, get_user_info
81
82
from datetime import datetime
82
83
import json
@@ -95,12 +96,32 @@ it will only run once. However, if you want to bypass this behavior,
95
96
``check_and_build_global_config() `` takes an optional boolean ``skip_config_creation `` parameter that
96
97
could be set to ``True `` at runtime to override the config creation.
97
98
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 following to the file:
114
+
115
+ .. code-block :: python
116
+ {" owner_name" : " Jane Doe" , " owner_email" : " janedoe@email.com" , " owner_orcid" : " 0000-0000-0000-0000" }
117
+
118
+
98
119
I entered the wrong information in my config file so it always loads incorrect information, how do I fix that?
99
120
--------------------------------------------------------------------------------------------------------------
100
121
101
122
It is easy to fix this simply by deleting the global and/or local config files, which will allow
102
123
you to re-enter the information during the ``check_and_build_global_config() `` initialization
103
- workflow. You can also simply editi the ``diffpyconfig.json `` file directly using a text
124
+ workflow. You can also simply edit the ``diffpyconfig.json `` file directly using a text
104
125
editor.
105
126
106
127
Locate the file ``diffpyconfig.json ``, in your home directory and open it in an editor ::
@@ -111,7 +132,7 @@ Locate the file ``diffpyconfig.json``, in your home directory and open it in an
111
132
"owner_orcid": "0000-0000-4321-1234"
112
133
}
113
134
114
- Then you can edit the username and email as needed, make sure to save your edits.
135
+ Then you can edit the username and email as needed, make sure to save your edits.
115
136
116
137
Automatically Capture Info about a Software Package Being Used
117
138
==============================================================
0 commit comments