Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
lichenggang
/
update_cate
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
6b3e43b5
authored
Jul 11, 2019
by
lichenggang
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
add qic
parent
a2b97153
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
2 deletions
plat/qic/__init__.py
plat/qic/cate_stock.py
utils/mysqlopera.py
plat/qic/__init__.py
0 → 100644
View file @
6b3e43b5
#!/usr/bin/env python
# -*- coding:utf-8 -*-
\ No newline at end of file
plat/qic/cate_stock.py
0 → 100644
View file @
6b3e43b5
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from
urllib.parse
import
quote
,
unquote
def
to_unicode
(
string
):
ret
=
''
for
v
in
string
:
ret
=
ret
+
hex
(
ord
(
v
))
.
upper
()
.
replace
(
'0X'
,
'
\\
u'
)
ret
=
ret
.
replace
(
'
\\
'
,
r'
%
'
)
return
ret
ori_levels
=
[{
"id"
:
1374
,
"infomation"
:
"集成电路"
,
"isType"
:
0
,
"keyName"
:
"集成电路"
,
"parentUuidkey"
:
"614a9e81-6925-4f9c-8b11-c51b5dbdee8c"
,
"productOrder"
:
1
,
"uuidkey"
:
"749ee7955da7470e814622a304a338a8qica"
,
"valueName"
:
"集成电路"
},{
"id"
:
1375
,
"infomation"
:
"分立器件"
,
"isType"
:
0
,
"keyName"
:
"分立器件"
,
"parentUuidkey"
:
"614a9e81-6925-4f9c-8b11-c51b5dbdee8c"
,
"productOrder"
:
2
,
"uuidkey"
:
"b1d6fe7c1d394cf4b053c6a1de7e6bb7qica"
,
"valueName"
:
"分立器件"
},{
"id"
:
1376
,
"infomation"
:
"电源芯片"
,
"isType"
:
0
,
"keyName"
:
"电源芯片"
,
"parentUuidkey"
:
"614a9e81-6925-4f9c-8b11-c51b5dbdee8c"
,
"productOrder"
:
3
,
"uuidkey"
:
"c34225972fda46fbbaaef2dfa28ba473qica"
,
"valueName"
:
"电源芯片"
},{
"id"
:
1377
,
"infomation"
:
"电路保护"
,
"isType"
:
0
,
"keyName"
:
"电路保护"
,
"parentUuidkey"
:
"614a9e81-6925-4f9c-8b11-c51b5dbdee8c"
,
"productOrder"
:
4
,
"uuidkey"
:
"5361ad2936e74258bf99ec786fbde640qica"
,
"valueName"
:
"电路保护"
},{
"id"
:
1378
,
"infomation"
:
"嵌入式处理器/微控制器"
,
"isType"
:
0
,
"keyName"
:
"嵌入式处理器/微控制器"
,
"parentUuidkey"
:
"614a9e81-6925-4f9c-8b11-c51b5dbdee8c"
,
"productOrder"
:
5
,
"uuidkey"
:
"f8271ae1b3b242d98112ec0cd39c70b7qica"
,
"valueName"
:
"嵌入式处理器/微控制器"
},{
"id"
:
1379
,
"infomation"
:
"传感器"
,
"isType"
:
0
,
"keyName"
:
"传感器"
,
"parentUuidkey"
:
"614a9e81-6925-4f9c-8b11-c51b5dbdee8c"
,
"productOrder"
:
6
,
"uuidkey"
:
"20b4499a5056451da3dbc5a8e95ba486qica"
,
"valueName"
:
"传感器"
},{
"id"
:
1387
,
"infomation"
:
"滤波器"
,
"isType"
:
0
,
"keyName"
:
"滤波器"
,
"parentUuidkey"
:
"614a9e81-6925-4f9c-8b11-c51b5dbdee8c"
,
"productOrder"
:
7
,
"uuidkey"
:
"aebd7af9be1c464190255b03baa55e74qica"
,
"valueName"
:
"滤波器"
},{
"id"
:
1383
,
"infomation"
:
"连接器"
,
"isType"
:
0
,
"keyName"
:
"连接器"
,
"parentUuidkey"
:
"614a9e81-6925-4f9c-8b11-c51b5dbdee8c"
,
"productOrder"
:
8
,
"uuidkey"
:
"2eb76dc16a8146b4acef3299448ac82fqica"
,
"valueName"
:
"连接器"
},{
"id"
:
1380
,
"infomation"
:
"电容"
,
"isType"
:
0
,
"keyName"
:
"电容"
,
"parentUuidkey"
:
"614a9e81-6925-4f9c-8b11-c51b5dbdee8c"
,
"productOrder"
:
9
,
"uuidkey"
:
"cb53eba685e5424199271bf257b4888bqica"
,
"valueName"
:
"电容"
},{
"id"
:
1381
,
"infomation"
:
"电阻"
,
"isType"
:
0
,
"keyName"
:
"电阻"
,
"parentUuidkey"
:
"614a9e81-6925-4f9c-8b11-c51b5dbdee8c"
,
"productOrder"
:
10
,
"uuidkey"
:
"6e43d04d05504ff7813ab2cd8a57f450qica"
,
"valueName"
:
"电阻"
},{
"id"
:
1386
,
"infomation"
:
"电感"
,
"isType"
:
0
,
"keyName"
:
"电感"
,
"parentUuidkey"
:
"614a9e81-6925-4f9c-8b11-c51b5dbdee8c"
,
"productOrder"
:
11
,
"uuidkey"
:
"fa8b118bc4a84a91997315e2320bb37aqica"
,
"valueName"
:
"电感"
},{
"id"
:
1385
,
"infomation"
:
"晶振"
,
"isType"
:
0
,
"keyName"
:
"晶振"
,
"parentUuidkey"
:
"614a9e81-6925-4f9c-8b11-c51b5dbdee8c"
,
"productOrder"
:
12
,
"uuidkey"
:
"6e74af19c08647ebb25a1d2214dfdb8eqica"
,
"valueName"
:
"晶振"
},{
"id"
:
1382
,
"infomation"
:
"LED照明"
,
"isType"
:
0
,
"keyName"
:
"LED照明"
,
"parentUuidkey"
:
"614a9e81-6925-4f9c-8b11-c51b5dbdee8c"
,
"productOrder"
:
13
,
"uuidkey"
:
"89e03c518c26473aa948d095044f63a6qica"
,
"valueName"
:
"LED照明"
},{
"id"
:
1388
,
"infomation"
:
"被动元器件"
,
"isType"
:
0
,
"keyName"
:
"被动元器件"
,
"parentUuidkey"
:
"614a9e81-6925-4f9c-8b11-c51b5dbdee8c"
,
"productOrder"
:
14
,
"uuidkey"
:
"c847eb2afb884ce0be12b880b9e0b864qica"
,
"valueName"
:
"被动元器件"
},{
"id"
:
1389
,
"infomation"
:
"其他元器件"
,
"isType"
:
0
,
"keyName"
:
"其他元器件"
,
"parentUuidkey"
:
"614a9e81-6925-4f9c-8b11-c51b5dbdee8c"
,
"productOrder"
:
15
,
"uuidkey"
:
"1250fee4532745ec80380b8c63b7d0fcqica"
,
"valueName"
:
"其他元器件"
},{
"id"
:
1384
,
"infomation"
:
"继电器/传感器"
,
"isType"
:
0
,
"keyName"
:
"继电器/传感器"
,
"parentUuidkey"
:
"614a9e81-6925-4f9c-8b11-c51b5dbdee8c"
,
"productOrder"
:
16
,
"uuidkey"
:
"c5186777e3a14180b5bfad5a1b50068dqica"
,
"valueName"
:
"继电器/传感器"
}]
levels
=
[]
for
_level1
in
ori_levels
:
level1
=
dict
()
t
,
token
,
cat_name
=
1
,
_level1
[
'uuidkey'
],
_level1
[
'infomation'
]
level1
[
'cat_name'
]
=
cat_name
level1
[
'url'
]
=
r'http://www.qic.com.cn/html/search_list.html?modelNumber=&quantity=&sfenlei=0&isLike=0&searchType=
%
s&type=1&uuidkey=
%
s&typeName=
%
s'
%
(
t
,
token
,
to_unicode
(
cat_name
))
level1
[
'level'
]
=
1
level1
[
'islast'
]
=
1
level1
[
'parent_id'
]
=
0
level1
[
'level2_list'
]
=
[]
levels
.
append
(
level1
)
print
(
levels
)
utils/mysqlopera.py
View file @
6b3e43b5
...
...
@@ -7,7 +7,7 @@ import pymysql
COMPANY_PN_LIST
=
[
'hc360'
,
'huangye88'
,
'pangwo'
,
'coovee'
,
'liebiao'
,
'china'
,
'ic114'
,
'cecb2b'
,
'trustexporter'
,
'x11467'
,
'x912688'
,
'zgtghccl'
,
'herostart'
,
'testmart'
,
'cc'
,
'eastsoo'
,
'x51sole'
,
'eb80'
,
'x258'
,
'taojindi'
,
'd17'
,
'etlong'
,
'mfqyw'
,
'pe168'
,
'qymgc'
,
'atobo'
,
'czvv'
]
'taojindi'
,
'd17'
,
'etlong'
,
'mfqyw'
,
'pe168'
,
'qymgc'
,
'atobo'
,
'czvv'
,
'qic'
]
def
get_env
():
...
...
@@ -25,7 +25,7 @@ HOST_SET = {
'produce'
:
'172.18.137.37'
}
UP_SET
=
{
'test'
:
(
'
oneyac'
,
'oneyac#zsyM
'
),
'test'
:
(
'
ichunt'
,
'ichunt
'
),
'produce'
:
(
'bigdata'
,
'bdYm2yy2mmyzlmlly'
)
}
...
...
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