Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
physical
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
physical
Commits
03b8b56d
Commit
03b8b56d
authored
Aug 19, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
56ec950d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
1 deletion
+55
-1
trans2es_mapping2es.py
trans2es/management/commands/trans2es_mapping2es.py
+5
-1
no_reply_principal.py
vest/pictorial/no_reply_principal.py
+50
-0
No files found.
trans2es/management/commands/trans2es_mapping2es.py
View file @
03b8b56d
...
@@ -16,7 +16,7 @@ from vest.fix import fix_no_comment_click
...
@@ -16,7 +16,7 @@ from vest.fix import fix_no_comment_click
from
vest.reply_answer
import
reply_comment2
,
reply_comment3
,
answer_reply2
,
answer_reply3
,
answer_reply1
from
vest.reply_answer
import
reply_comment2
,
reply_comment3
,
answer_reply2
,
answer_reply3
,
answer_reply1
from
vest.request
import
get_session
,
auto_user_id
from
vest.request
import
get_session
,
auto_user_id
from
vest.vest_majiauser
import
vest_click_reply
from
vest.vest_majiauser
import
vest_click_reply
from
vest.pictorial
import
principal_offline_comment1
,
principal_online_comment1
from
vest.pictorial
import
principal_offline_comment1
,
principal_online_comment1
,
no_reply_principal
class
Command
(
BaseCommand
):
class
Command
(
BaseCommand
):
...
@@ -143,5 +143,9 @@ class Command(BaseCommand):
...
@@ -143,5 +143,9 @@ class Command(BaseCommand):
if
options
[
"mvest"
]
==
"principal_online_comment1"
:
if
options
[
"mvest"
]
==
"principal_online_comment1"
:
principal_online_comment1
.
principal_online_comment1
()
principal_online_comment1
.
principal_online_comment1
()
if
options
[
"mvest"
]
==
"no_reply_principal"
:
no_reply_principal
.
no_reply_principal
()
except
:
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
vest/pictorial/no_reply_principal.py
0 → 100644
View file @
03b8b56d
import
pymysql
import
random
import
traceback
import
logging
from
vest.request.auto_request
import
logins
,
pictorial_reply
,
get_majia_reply
,
get_pictorial_comment
from
vest.request.auto_request
import
host
,
user
,
db
,
passwd
"""
离线一次性插入{1,4}条评论
"""
def
get_data
():
try
:
print
(
"...."
)
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
cursor
.
execute
(
"select id from community_pictorial where id not in (select pictorial_id from reply group by pictorial_id)"
)
data
=
cursor
.
fetchall
()
topic_id
=
list
(
data
)
logging
.
info
(
"Database version :
%
s "
%
topic_id
)
return
topic_id
except
:
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
[]
def
no_reply_principal
():
try
:
logging
.
info
(
"comment offline pictorial"
)
user_id
=
get_data
()
dicts
=
{}
for
i
in
user_id
:
for
num
in
range
(
4
):
majia_user_id
=
get_majia_reply
(
i
[
0
])
cook
=
logins
(
majia_user_id
)
comment
=
get_pictorial_comment
()
if
cook
is
not
None
:
logging
.
info
(
"get cook:
%
s"
%
cook
)
logging
.
info
(
"get i[1]:
%
s"
%
i
[
1
])
logging
.
info
(
"get comment:
%
s"
%
comment
)
pictorial_reply
(
cook
,
i
[
1
],
comment
)
else
:
logging
.
info
(
"no get cookies-------------"
)
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
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