Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cybertron
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
alpha
cybertron
Commits
f9ae99ec
Commit
f9ae99ec
authored
Jul 11, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
二级评价
parent
bf753fcf
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
231 additions
and
61 deletions
+231
-61
workspace.xml
.idea/workspace.xml
+50
-57
answer_reply1.py
answer_reply1.py
+2
-2
answer_reply2.py
answer_reply2.py
+68
-0
answer_reply3.py
answer_reply3.py
+67
-0
reply_comment1.py
reply_comment1.py
+2
-2
reply_comment2.py
reply_comment2.py
+20
-0
reply_comment3.py
reply_comment3.py
+22
-0
No files found.
.idea/workspace.xml
View file @
f9ae99ec
...
...
@@ -2,7 +2,11 @@
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"7b835479-ee84-40d6-9b97-0e9285d92119"
name=
"Default Changelist"
comment=
""
>
<change
afterPath=
"$PROJECT_DIR$/answer_reply2.py"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/answer_reply3.py"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/reply_comment2.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/answer_reply.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/answer_reply1.py"
afterDir=
"false"
/>
</list>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
...
...
@@ -13,24 +17,26 @@
<session
id=
"-334786743"
>
<usages-collector
id=
"statistics.file.extensions.open"
>
<counts>
<entry
key=
"py"
value=
"
8
"
/>
<entry
key=
"py"
value=
"
11
"
/>
<entry
key=
"txt"
value=
"3"
/>
</counts>
</usages-collector>
<usages-collector
id=
"statistics.file.types.open"
>
<counts>
<entry
key=
"PLAIN_TEXT"
value=
"3"
/>
<entry
key=
"Python"
value=
"
8
"
/>
<entry
key=
"Python"
value=
"
11
"
/>
</counts>
</usages-collector>
<usages-collector
id=
"statistics.file.extensions.edit"
>
<counts>
<entry
key=
"py"
value=
"823"
/>
<entry
key=
"dummy"
value=
"1"
/>
<entry
key=
"py"
value=
"833"
/>
</counts>
</usages-collector>
<usages-collector
id=
"statistics.file.types.edit"
>
<counts>
<entry
key=
"Python"
value=
"823"
/>
<entry
key=
"PLAIN_TEXT"
value=
"1"
/>
<entry
key=
"Python"
value=
"833"
/>
</counts>
</usages-collector>
</session>
...
...
@@ -54,8 +60,8 @@
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/reply_comment1.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
36
0"
>
<caret
line=
"
24"
column=
"31"
lean-forward=
"true"
selection-start-line=
"24"
selection-start-column=
"31"
selection-end-line=
"24"
selection-end-column=
"31
"
/>
<state
relative-caret-position=
"
45
0"
>
<caret
line=
"
30"
lean-forward=
"true"
selection-start-line=
"30"
selection-end-line=
"30
"
/>
<folding>
<element
signature=
"e#0#16#0"
expanded=
"true"
/>
</folding>
...
...
@@ -64,46 +70,10 @@
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"true"
>
<entry
file=
"file://$PROJECT_DIR$/
answer_reply
.py"
>
<entry
file=
"file://$PROJECT_DIR$/
reply_comment2
.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"138"
>
<caret
line=
"49"
column=
"31"
lean-forward=
"true"
selection-start-line=
"49"
selection-start-column=
"31"
selection-end-line=
"49"
selection-end-column=
"31"
/>
</state>
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/auto_comment1.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"105"
>
<caret
line=
"7"
lean-forward=
"true"
selection-start-line=
"7"
selection-end-line=
"7"
/>
<folding>
<element
signature=
"e#0#14#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/auto_comment.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"195"
>
<caret
line=
"13"
column=
"13"
selection-end-line=
"90"
/>
<folding>
<element
signature=
"e#0#15#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/auto_click1.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"135"
>
<caret
line=
"9"
selection-end-line=
"51"
selection-end-column=
"73"
/>
<folding>
<element
signature=
"e#0#11#0"
expanded=
"true"
/>
</folding>
<state>
<caret
selection-end-line=
"5"
/>
</state>
</provider>
</entry>
...
...
@@ -130,9 +100,11 @@
<list>
<option
value=
"$PROJECT_DIR$/answer2.txt"
/>
<option
value=
"$PROJECT_DIR$/answer1.txt"
/>
<option
value=
"$PROJECT_DIR$/answer_reply.py"
/>
<option
value=
"$PROJECT_DIR$/reply_comment1.py"
/>
<option
value=
"$PROJECT_DIR$/auto_request.py"
/>
<option
value=
"$PROJECT_DIR$/answer_reply.py"
/>
<option
value=
"$PROJECT_DIR$/answer_reply2.py"
/>
<option
value=
"$PROJECT_DIR$/answer_reply3.py"
/>
</list>
</option>
</component>
...
...
@@ -218,7 +190,7 @@
<layout>
<window_info
id=
"Structure"
order=
"0"
sideWeight=
"0.21188119"
side_tool=
"true"
weight=
"0.19112115"
/>
<window_info
id=
"Favorites"
order=
"1"
side_tool=
"true"
/>
<window_info
content_ui=
"combo"
id=
"Project"
order=
"2"
sideWeight=
"0.7872763"
visible=
"true"
weight=
"0.079428114
"
/>
<window_info
active=
"true"
content_ui=
"combo"
id=
"Project"
order=
"2"
sideWeight=
"0.7872763"
visible=
"true"
weight=
"0.1985703
"
/>
<window_info
id=
"DB Browser"
order=
"3"
/>
<window_info
anchor=
"bottom"
id=
"Message"
order=
"0"
/>
<window_info
anchor=
"bottom"
id=
"Find"
order=
"1"
weight=
"0.3284974"
/>
...
...
@@ -228,7 +200,7 @@
<window_info
anchor=
"bottom"
id=
"Inspection"
order=
"5"
weight=
"0.4"
/>
<window_info
anchor=
"bottom"
id=
"TODO"
order=
"6"
/>
<window_info
anchor=
"bottom"
id=
"Version Control"
order=
"7"
show_stripe_button=
"false"
/>
<window_info
a
ctive=
"true"
a
nchor=
"bottom"
id=
"Terminal"
order=
"8"
sideWeight=
"0.49960285"
visible=
"true"
weight=
"0.0"
/>
<window_info
anchor=
"bottom"
id=
"Terminal"
order=
"8"
sideWeight=
"0.49960285"
visible=
"true"
weight=
"0.0"
/>
<window_info
anchor=
"bottom"
id=
"Event Log"
order=
"9"
sideWeight=
"0.50039715"
side_tool=
"true"
weight=
"0.32890365"
/>
<window_info
anchor=
"bottom"
id=
"Python Console"
order=
"10"
/>
<window_info
anchor=
"bottom"
id=
"DB Execution Console"
order=
"11"
/>
...
...
@@ -430,13 +402,10 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/
reply_comment1
.py"
>
<entry
file=
"file://$PROJECT_DIR$/
answer_reply3
.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"360"
>
<caret
line=
"24"
column=
"31"
lean-forward=
"true"
selection-start-line=
"24"
selection-start-column=
"31"
selection-end-line=
"24"
selection-end-column=
"31"
/>
<folding>
<element
signature=
"e#0#16#0"
expanded=
"true"
/>
</folding>
<state
relative-caret-position=
"337"
>
<caret
line=
"47"
column=
"51"
lean-forward=
"true"
selection-start-line=
"47"
selection-start-column=
"51"
selection-end-line=
"47"
selection-end-column=
"51"
/>
</state>
</provider>
</entry>
...
...
@@ -452,10 +421,34 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/answer_reply.py"
>
<entry
file=
"file://$PROJECT_DIR$/answer_reply1.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"202"
>
<caret
line=
"54"
column=
"36"
selection-start-line=
"54"
selection-start-column=
"36"
selection-end-line=
"54"
selection-end-column=
"36"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/answer_reply2.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"210"
>
<caret
line=
"46"
column=
"46"
lean-forward=
"true"
selection-start-line=
"46"
selection-start-column=
"46"
selection-end-line=
"46"
selection-end-column=
"46"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/reply_comment1.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"450"
>
<caret
line=
"30"
lean-forward=
"true"
selection-start-line=
"30"
selection-end-line=
"30"
/>
<folding>
<element
signature=
"e#0#16#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/reply_comment2.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"138"
>
<caret
line=
"49"
column=
"31"
lean-forward=
"true"
selection-start-line=
"49"
selection-start-column=
"31"
selection-end-line=
"49"
selection-end-column=
"31
"
/>
<state>
<caret
selection-end-line=
"5
"
/>
</state>
</provider>
</entry>
...
...
answer_reply.py
→
answer_reply
1
.py
View file @
f9ae99ec
...
...
@@ -45,8 +45,8 @@ if __name__ == "__main__":
logging
.
info
(
"comment answer one"
)
numtime1
,
numtime2
=
time_conv
(
5
,
0
)
user_id
=
get_data
(
numtime1
,
numtime2
)
redis_key1
=
"cybertron:set_reply_id:
fiv
e1"
redis_key2
=
"cybertron:set_reply_id:
fiv
e2"
redis_key1
=
"cybertron:set_reply_id:
on
e1"
redis_key2
=
"cybertron:set_reply_id:
on
e2"
reply_data_comment
=
[]
if
user_id
:
for
i
in
user_id
:
...
...
answer_reply2.py
0 → 100644
View file @
f9ae99ec
import
pymysql
import
traceback
import
logging
import
json
from
log_settings
import
*
from
auto_request
import
login
,
reply
,
get_comment
,
time_conv
,
get_answer_data
,
reply_answer
,
set_reply_to_redis
from
auto_request
import
host
,
user
,
db
,
passwd
def
get_data
(
numtime
,
numtime2
):
try
:
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
cursor
.
execute
(
"SELECT user_id,id FROM topic WHERE is_online=1 and (create_time > '
%
s' and create_time < '
%
s' )"
%
(
numtime
,
numtime2
))
data
=
cursor
.
fetchall
()
topic_id
=
list
(
data
)
topic_id_list
=
[]
try
:
for
i
in
topic_id
and
topic_id
:
cursor
.
execute
(
"select user_id from user_extra where user_id ="
+
str
(
i
[
0
])
+
" and is_shadow =0"
)
data
=
cursor
.
fetchall
()
user_id
=
list
(
data
)
print
(
user_id
)
if
user_id
:
topic_id_list
.
append
(
i
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
pc
.
close
()
except
:
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
topic_id_list
except
:
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
[]
if
__name__
==
"__main__"
:
try
:
logging
.
info
(
"comment answer one"
)
numtime1
,
numtime2
=
time_conv
(
27
,
17
)
user_id
=
get_data
(
numtime1
,
numtime2
)
redis_key
=
"cybertron:set_reply_id:two"
reply_data_comment
=
[]
if
user_id
:
for
i
in
user_id
:
cook
=
login
()
comment1
,
comment2
=
get_answer_data
()
if
cook
is
not
None
:
response
=
reply_answer
(
cook
,
i
[
1
],
comment1
)
if
len
(
response
)
>
1
:
data_dict
=
json
.
loads
(
response
)
reply_id
=
data_dict
[
"data"
][
"id"
]
reply_user_id
=
data_dict
[
"data"
][
"id"
][
"user"
][
"id"
]
reply_data_comment
.
append
(
{
"id"
:
reply_id
,
"reply_user_id"
:
reply_user_id
,
"answer"
:
comment2
,
"topic_id"
:
i
[
1
]})
redis_client
=
set_reply_to_redis
()
redis_client
.
set
(
redis_key
,
json
.
dumps
(
reply_data_comment
))
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
answer_reply3.py
0 → 100644
View file @
f9ae99ec
import
pymysql
import
traceback
import
logging
import
json
from
log_settings
import
*
from
auto_request
import
login
,
reply
,
get_comment
,
time_conv
,
get_answer_data
,
reply_answer
,
set_reply_to_redis
from
auto_request
import
host
,
user
,
db
,
passwd
def
get_data
(
numtime
,
numtime2
):
try
:
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
cursor
.
execute
(
"SELECT user_id,id FROM topic WHERE is_online=1 and (create_time > '
%
s' and create_time < '
%
s' )"
%
(
numtime
,
numtime2
))
data
=
cursor
.
fetchall
()
topic_id
=
list
(
data
)
topic_id_list
=
[]
try
:
for
i
in
topic_id
and
topic_id
:
cursor
.
execute
(
"select user_id from user_extra where user_id ="
+
str
(
i
[
0
])
+
" and is_shadow =0"
)
data
=
cursor
.
fetchall
()
user_id
=
list
(
data
)
print
(
user_id
)
if
user_id
:
topic_id_list
.
append
(
i
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
pc
.
close
()
except
:
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
topic_id_list
except
:
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
[]
if
__name__
==
"__main__"
:
try
:
logging
.
info
(
"comment answer one"
)
numtime1
,
numtime2
=
time_conv
(
45
,
35
)
user_id
=
get_data
(
numtime1
,
numtime2
)
redis_key1
=
"cybertron:set_reply_id:three"
reply_data_comment
=
[]
if
user_id
:
for
i
in
user_id
:
cook
=
login
()
comment1
,
comment2
=
get_answer_data
()
if
cook
is
not
None
:
response
=
reply_answer
(
cook
,
i
[
1
],
comment1
)
if
len
(
response
)
>
1
:
data_dict
=
json
.
loads
(
response
)
reply_id
=
data_dict
[
"data"
][
"id"
]
reply_user_id
=
data_dict
[
"data"
][
"id"
][
"user"
][
"id"
]
reply_data_comment
.
append
(
{
"id"
:
reply_id
,
"reply_user_id"
:
reply_user_id
,
"answer"
:
comment2
,
"topic_id"
:
i
[
1
]})
redis_client
=
set_reply_to_redis
()
redis_client
.
set
(
redis_key1
,
json
.
dumps
(
reply_data_comment
))
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
reply_comment1.py
View file @
f9ae99ec
...
...
@@ -7,8 +7,8 @@ from auto_request import set_reply_to_redis, reply2, login
if
__name__
==
"__main__"
:
try
:
redis_key1
=
"cybertron:set_reply_id:
fiv
e1"
redis_key2
=
"cybertron:set_reply_id:
fiv
e2"
redis_key1
=
"cybertron:set_reply_id:
on
e1"
redis_key2
=
"cybertron:set_reply_id:
on
e2"
redis_client
=
set_reply_to_redis
()
...
...
reply_comment2.py
0 → 100644
View file @
f9ae99ec
import
traceback
import
redis
import
logging
import
json
from
auto_request
import
set_reply_to_redis
,
reply2
,
login
if
__name__
==
"__main__"
:
try
:
redis_key1
=
"cybertron:set_reply_id:two1"
redis_client
=
set_reply_to_redis
()
have_reply1
=
redis_client
.
get
(
redis_key1
)
result
=
json
.
loads
(
str
(
have_reply1
,
encoding
=
"utf-8"
))
if
result
:
for
item
in
result
:
cook
=
login
()
reply2
(
cook
,
item
[
"topic_id"
],
item
[
"answer"
],
item
[
"id"
])
redis_client
.
delete
(
redis_key1
)
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
reply_comment3.py
0 → 100644
View file @
f9ae99ec
import
traceback
import
redis
import
logging
import
json
from
auto_request
import
set_reply_to_redis
,
reply2
,
login
if
__name__
==
"__main__"
:
try
:
redis_key1
=
"cybertron:set_reply_id:three"
redis_client
=
set_reply_to_redis
()
have_reply1
=
redis_client
.
get
(
redis_key1
)
result
=
json
.
loads
(
str
(
have_reply1
,
encoding
=
"utf-8"
))
if
result
:
for
item
in
result
:
cook
=
login
()
reply2
(
cook
,
item
[
"topic_id"
],
item
[
"answer"
],
item
[
"id"
])
redis_client
.
delete
(
redis_key1
)
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