Skip to content

Commit 7112fac

Browse files
Alison WuAlison Wu
authored andcommitted
Add warning to missing global config file
1 parent f17b979 commit 7112fac

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

news/get-user-fix.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* Warning message for missing global config file
4+
5+
**Changed:**
6+
7+
* <news item>
8+
9+
**Deprecated:**
10+
11+
* <news item>
12+
13+
**Removed:**
14+
15+
* <news item>
16+
17+
**Fixed:**
18+
19+
* <news item>
20+
21+
**Security:**
22+
23+
* <news item>

src/diffpy/utils/tools.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import os
44
from copy import copy
55
from pathlib import Path
6+
import warnings
67

78

89
def clean_dict(obj):
@@ -114,6 +115,7 @@ def get_user_info(args=None):
114115
global_config = load_config(Path().home() / "diffpyconfig.json")
115116
local_config = load_config(Path().cwd() / "diffpyconfig.json")
116117
if global_config is None and local_config is None:
118+
warnings.warn("No global config file, please follow prompts below. For more information, refer to www.diffpy.org/diffpy.utils/")
117119
config_bool = _create_global_config(args)
118120
global_config = load_config(Path().home() / "diffpyconfig.json")
119121
config = _sorted_merge(clean_dict(global_config), clean_dict(local_config), clean_dict(args))

0 commit comments

Comments
 (0)