@@ -77,13 +77,9 @@ def _sorted_merge(*dicts):
7777
7878def _create_global_config (args ):
7979 username = input (
80- f"Please enter the name of the user to put in the diffpy global config file "
81- f"[{ args .get ('username' , '' )} ]: "
80+ f"Please enter the name you would want future work to be credited to " f"[{ args .get ('username' , '' )} ]: "
8281 ).strip () or args .get ("username" , "" )
83- email = input (
84- f"Please enter the email of the user to put in the diffpy global config file "
85- f"[{ args .get ('email' , '' )} ]: "
86- ).strip () or args .get ("email" , "" )
82+ email = input (f"Please enter the your email " f"[{ args .get ('email' , '' )} ]: " ).strip () or args .get ("email" , "" )
8783 return_bool = False if username is None or email is None else True
8884 with open (Path ().home () / "diffpyconfig.json" , "w" ) as f :
8985 f .write (json .dumps ({"username" : stringify (username ), "email" : stringify (email )}))
@@ -114,6 +110,15 @@ def get_user_info(args=None):
114110 global_config = load_config (Path ().home () / "diffpyconfig.json" )
115111 local_config = load_config (Path ().cwd () / "diffpyconfig.json" )
116112 if global_config is None and local_config is None :
113+ print (
114+ "No global configuration file was found containing "
115+ "information about the user to associate with the data.\n "
116+ "By following the prompts below you can add your name and email to this file on the current"
117+ " computer and your name will be automatically associated with subsequent diffpy data by default.\n "
118+ "This is not recommended on a shared or public computer. "
119+ "You will only have to do that once.\n "
120+ "For more information, please refer to www.diffpy.org/diffpy.utils/examples/toolsexample.html"
121+ )
117122 config_bool = _create_global_config (args )
118123 global_config = load_config (Path ().home () / "diffpyconfig.json" )
119124 config = _sorted_merge (clean_dict (global_config ), clean_dict (local_config ), clean_dict (args ))
0 commit comments