pycoze 0.1.179__py3-none-any.whl → 0.1.180__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pycoze/utils/__init__.py +2 -1
- pycoze/utils/arg.py +1 -16
- pycoze/utils/env.py +20 -0
- {pycoze-0.1.179.dist-info → pycoze-0.1.180.dist-info}/METADATA +1 -1
- {pycoze-0.1.179.dist-info → pycoze-0.1.180.dist-info}/RECORD +8 -7
- {pycoze-0.1.179.dist-info → pycoze-0.1.180.dist-info}/LICENSE +0 -0
- {pycoze-0.1.179.dist-info → pycoze-0.1.180.dist-info}/WHEEL +0 -0
- {pycoze-0.1.179.dist-info → pycoze-0.1.180.dist-info}/top_level.txt +0 -0
pycoze/utils/__init__.py
CHANGED
pycoze/utils/arg.py
CHANGED
@@ -7,6 +7,7 @@ def read_arg(param, is_path=False, posix=True):
|
|
7
7
|
while param.startswith("-"):
|
8
8
|
param = param[1:]
|
9
9
|
args = sys.argv[1:]
|
10
|
+
value = None
|
10
11
|
for i in range(len(args)):
|
11
12
|
if args[i] == "-" + param or args[i] == "--" + param:
|
12
13
|
value = args[i + 1]
|
@@ -20,19 +21,3 @@ def read_arg(param, is_path=False, posix=True):
|
|
20
21
|
return value
|
21
22
|
|
22
23
|
|
23
|
-
def read_params_file():
|
24
|
-
params_file = read_arg("params_file", True)
|
25
|
-
params = None
|
26
|
-
try:
|
27
|
-
with open(params_file, "r", encoding="utf-8") as f:
|
28
|
-
params = json.load(f)
|
29
|
-
except Exception as e:
|
30
|
-
print(e)
|
31
|
-
return params
|
32
|
-
|
33
|
-
def read_json_file(filename):
|
34
|
-
params = read_params_file()
|
35
|
-
json_file = os.path.join(params['appPath'], 'JsonStorage', filename)
|
36
|
-
with open(json_file, encoding='utf-8') as f:
|
37
|
-
return json.load(f)
|
38
|
-
|
pycoze/utils/env.py
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
import os
|
2
|
+
|
3
|
+
|
4
|
+
def read_params_file():
|
5
|
+
params_file = os.getenv("params_file", None)
|
6
|
+
params = None
|
7
|
+
if params_file:
|
8
|
+
try:
|
9
|
+
with open(params_file, "r", encoding="utf-8") as f:
|
10
|
+
params = json.load(f)
|
11
|
+
except Exception as e:
|
12
|
+
print(e)
|
13
|
+
return params
|
14
|
+
|
15
|
+
def read_json_file(filename):
|
16
|
+
params = read_params_file()
|
17
|
+
json_file = os.path.join(params['appPath'], 'JsonStorage', filename)
|
18
|
+
with open(json_file, encoding='utf-8') as f:
|
19
|
+
return json.load(f)
|
20
|
+
|
@@ -20,11 +20,12 @@ pycoze/ui/base.py,sha256=yFkKOLsb6AYbZVv051zzMqaTsvRG6P7cCCz4VU9CEj8,1133
|
|
20
20
|
pycoze/ui/color.py,sha256=cT9Ib8uNzkOKxyW0IwVj46o4LwdB1xgNCj1_Rou9d_4,854
|
21
21
|
pycoze/ui/typ.py,sha256=NpT0FrbHvByOszBZMFtroRp7I7pN-38tYz_zPOPejF4,1723
|
22
22
|
pycoze/ui/ui_def.py,sha256=UhhU_yB3GV9ISbvTWT48hsHPHI250BhMILh6bu5Uioo,4206
|
23
|
-
pycoze/utils/__init__.py,sha256=
|
24
|
-
pycoze/utils/arg.py,sha256=
|
23
|
+
pycoze/utils/__init__.py,sha256=Gi5EnrWZGMD2JRejgV4c_VLCXyvA2wwBFI_niDF5MUE,110
|
24
|
+
pycoze/utils/arg.py,sha256=GtfGbMTMdaK75Fwh6MpUe1pCA5X6Ep4LFG7a72YrzjI,525
|
25
|
+
pycoze/utils/env.py,sha256=OXDevzpz76WKD5O4sEbhi6tlPd9BeN_uZ2GkarOrHOY,548
|
25
26
|
pycoze/utils/text_or_file.py,sha256=gpxZVWt2DW6YiEg_MnMuwg36VNf3TX383QD_1oZNB0Y,551
|
26
|
-
pycoze-0.1.
|
27
|
-
pycoze-0.1.
|
28
|
-
pycoze-0.1.
|
29
|
-
pycoze-0.1.
|
30
|
-
pycoze-0.1.
|
27
|
+
pycoze-0.1.180.dist-info/LICENSE,sha256=QStd_Qsd0-kAam_-sOesCIp_uKrGWeoKwt9M49NVkNU,1090
|
28
|
+
pycoze-0.1.180.dist-info/METADATA,sha256=tG7ZSPEODLJSNiX_Ou2tHv2Yu7osuGsaucOo7w9BDKY,726
|
29
|
+
pycoze-0.1.180.dist-info/WHEEL,sha256=bFJAMchF8aTQGUgMZzHJyDDMPTO3ToJ7x23SLJa1SVo,92
|
30
|
+
pycoze-0.1.180.dist-info/top_level.txt,sha256=76dPeDhKvOCleL3ZC5gl1-y4vdS1tT_U1hxWVAn7sFo,7
|
31
|
+
pycoze-0.1.180.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|