Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
岳巧源
/
python_resolve_data
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
0bf688c3
authored
Aug 29, 2024
by
岳巧源
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
modify script
parent
4d47ba28
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
chip1stop.py
chip1stop.py
View file @
0bf688c3
...
...
@@ -17,7 +17,7 @@ txt文件都是固定文件名
此脚本每天晚上 23:40运行 用于解析当天上传的文件
"""
ftp_remote_path_csv
=
"/Chip1Stop_TI_included_"
+
datetime
.
datetime
.
now
()
.
strftime
(
"
%
Y
%
m
%
d"
)
+
"_ETCHIPS.csv.gz"
ftp_remote_path_txt
=
"/Chip1StopStockList
RMB_Anjie_US Stock
.txt.gz"
ftp_remote_path_txt
=
"/Chip1StopStockList
_TI_in_ RMB_Anjie_RMB
.txt.gz"
"""暂时设置为当前路径"""
# file_local_path_csv = "." + ftp_remote_path_csv
...
...
@@ -179,6 +179,7 @@ class DataUtil:
return
with
open
(
file_path
,
errors
=
'ignore'
)
as
f
:
content_list
=
f
.
readlines
()
print
(
content_list
[
0
]
.
split
(
"
\t
"
))
for
index
in
range
(
len
(
content_list
)):
if
index
>
100
:
break
...
...
@@ -189,7 +190,7 @@ class DataUtil:
table
=
dict
()
"""RMB接口 都是txt文件格式"""
table
[
"price_is_us"
]
=
False
table
[
"supplier_name"
]
=
""
table
[
"supplier_name"
]
=
"
Chip1stop-CN
"
table
[
"multiple"
]
=
"1"
table
[
"batch_sn"
]
=
{}
table
[
"eccn"
]
=
""
...
...
@@ -279,10 +280,6 @@ class Producer:
print
(
e
)
# TODO 美元和人民币接口的供应商不一样
"""
供应商的名字记得修改
"""
if
__name__
==
'__main__'
:
if
ENV
==
"test"
:
config
=
config_test
...
...
@@ -294,4 +291,3 @@ if __name__ == '__main__':
# u.download(ftp_remote_path_txt, file_local_path_txt)
# u.ungz(file_local_path_txt)
u
.
handle_txt
(
file_local_path_txt
.
replace
(
".gz"
,
""
))
# u.handle_txt()
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