Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
岳巧源
/
europa-erp-python
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
012fc8cd
authored
Sep 14, 2024
by
岳巧源
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
add new config
parent
1899007f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
0 deletions
supplier/config.py
utils/__init__.py
utils/file_handle.py
supplier/config.py
0 → 100644
View file @
012fc8cd
import
os.path
import
json
def
load_config
()
->
str
:
current_path
=
os
.
path
.
abspath
(
__file__
)
dir_path
=
os
.
path
.
dirname
(
current_path
)
config_path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
dir_path
),
"config.json"
)
return
config_path
CONFIG_PATH
=
load_config
()
__all__
=
[
"CONFIG_PATH"
]
utils/__init__.py
View file @
012fc8cd
from
.file_handle
import
load_json
__all__
=
[
"load_json"
]
\ No newline at end of file
utils/file_handle.py
View file @
012fc8cd
import
gzip
import
gzip
import
json
import
zipfile
import
zipfile
...
@@ -20,3 +21,8 @@ def ungz(file_path: str, save_path: str):
...
@@ -20,3 +21,8 @@ def ungz(file_path: str, save_path: str):
g_file
=
gzip
.
GzipFile
(
file_path
)
g_file
=
gzip
.
GzipFile
(
file_path
)
open
(
save_path
+
new_file_name
,
"wb+"
)
.
write
(
g_file
.
read
())
open
(
save_path
+
new_file_name
,
"wb+"
)
.
write
(
g_file
.
read
())
g_file
.
close
()
g_file
.
close
()
def
load_json
(
json_content
)
->
dict
:
"""convert json content to dict"""
return
json
.
loads
(
json_content
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment