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
297c9dd6
Commit
297c9dd6
authored
Aug 19, 2019
by
段英荣
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'topic_update_time' into 'master'
Topic update time See merge request
alpha/physical!422
parents
56ec950d
e34881f9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
1 deletion
+54
-1
trans2es_mapping2es.py
trans2es/management/commands/trans2es_mapping2es.py
+5
-1
no_reply_principal.py
vest/pictorial/no_reply_principal.py
+49
-0
No files found.
trans2es/management/commands/trans2es_mapping2es.py
View file @
297c9dd6
...
...
@@ -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.request
import
get_session
,
auto_user_id
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
):
...
...
@@ -143,5 +143,9 @@ class Command(BaseCommand):
if
options
[
"mvest"
]
==
"principal_online_comment1"
:
principal_online_comment1
.
principal_online_comment1
()
if
options
[
"mvest"
]
==
"no_reply_principal"
:
no_reply_principal
.
no_reply_principal
()
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
vest/pictorial/no_reply_principal.py
0 → 100644
View file @
297c9dd6
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 creator_id,id from community_pictorial where is_online =True and 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