Commit f9ae99ec authored by lixiaofang's avatar lixiaofang

二级评价

parent bf753fcf
...@@ -2,7 +2,11 @@ ...@@ -2,7 +2,11 @@
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="7b835479-ee84-40d6-9b97-0e9285d92119" name="Default Changelist" comment=""> <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$/.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> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
...@@ -13,24 +17,26 @@ ...@@ -13,24 +17,26 @@
<session id="-334786743"> <session id="-334786743">
<usages-collector id="statistics.file.extensions.open"> <usages-collector id="statistics.file.extensions.open">
<counts> <counts>
<entry key="py" value="8" /> <entry key="py" value="11" />
<entry key="txt" value="3" /> <entry key="txt" value="3" />
</counts> </counts>
</usages-collector> </usages-collector>
<usages-collector id="statistics.file.types.open"> <usages-collector id="statistics.file.types.open">
<counts> <counts>
<entry key="PLAIN_TEXT" value="3" /> <entry key="PLAIN_TEXT" value="3" />
<entry key="Python" value="8" /> <entry key="Python" value="11" />
</counts> </counts>
</usages-collector> </usages-collector>
<usages-collector id="statistics.file.extensions.edit"> <usages-collector id="statistics.file.extensions.edit">
<counts> <counts>
<entry key="py" value="823" /> <entry key="dummy" value="1" />
<entry key="py" value="833" />
</counts> </counts>
</usages-collector> </usages-collector>
<usages-collector id="statistics.file.types.edit"> <usages-collector id="statistics.file.types.edit">
<counts> <counts>
<entry key="Python" value="823" /> <entry key="PLAIN_TEXT" value="1" />
<entry key="Python" value="833" />
</counts> </counts>
</usages-collector> </usages-collector>
</session> </session>
...@@ -54,8 +60,8 @@ ...@@ -54,8 +60,8 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/reply_comment1.py"> <entry file="file://$PROJECT_DIR$/reply_comment1.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="360"> <state relative-caret-position="450">
<caret line="24" column="31" lean-forward="true" selection-start-line="24" selection-start-column="31" selection-end-line="24" selection-end-column="31" /> <caret line="30" lean-forward="true" selection-start-line="30" selection-end-line="30" />
<folding> <folding>
<element signature="e#0#16#0" expanded="true" /> <element signature="e#0#16#0" expanded="true" />
</folding> </folding>
...@@ -64,46 +70,10 @@ ...@@ -64,46 +70,10 @@
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="true"> <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"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="138"> <state>
<caret line="49" column="31" lean-forward="true" selection-start-line="49" selection-start-column="31" selection-end-line="49" selection-end-column="31" /> <caret selection-end-line="5" />
</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> </state>
</provider> </provider>
</entry> </entry>
...@@ -130,9 +100,11 @@ ...@@ -130,9 +100,11 @@
<list> <list>
<option value="$PROJECT_DIR$/answer2.txt" /> <option value="$PROJECT_DIR$/answer2.txt" />
<option value="$PROJECT_DIR$/answer1.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$/reply_comment1.py" />
<option value="$PROJECT_DIR$/auto_request.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> </list>
</option> </option>
</component> </component>
...@@ -218,7 +190,7 @@ ...@@ -218,7 +190,7 @@
<layout> <layout>
<window_info id="Structure" order="0" sideWeight="0.21188119" side_tool="true" weight="0.19112115" /> <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 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 id="DB Browser" order="3" />
<window_info anchor="bottom" id="Message" order="0" /> <window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" weight="0.3284974" /> <window_info anchor="bottom" id="Find" order="1" weight="0.3284974" />
...@@ -228,7 +200,7 @@ ...@@ -228,7 +200,7 @@
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" /> <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" /> <window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Version Control" order="7" show_stripe_button="false" /> <window_info anchor="bottom" id="Version Control" order="7" show_stripe_button="false" />
<window_info active="true" anchor="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="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="Python Console" order="10" />
<window_info anchor="bottom" id="DB Execution Console" order="11" /> <window_info anchor="bottom" id="DB Execution Console" order="11" />
...@@ -430,13 +402,10 @@ ...@@ -430,13 +402,10 @@
</state> </state>
</provider> </provider>
</entry> </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"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="360"> <state relative-caret-position="337">
<caret line="24" column="31" lean-forward="true" selection-start-line="24" selection-start-column="31" selection-end-line="24" selection-end-column="31" /> <caret line="47" column="51" lean-forward="true" selection-start-line="47" selection-start-column="51" selection-end-line="47" selection-end-column="51" />
<folding>
<element signature="e#0#16#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
...@@ -452,10 +421,34 @@ ...@@ -452,10 +421,34 @@
</state> </state>
</provider> </provider>
</entry> </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"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="138"> <state>
<caret line="49" column="31" lean-forward="true" selection-start-line="49" selection-start-column="31" selection-end-line="49" selection-end-column="31" /> <caret selection-end-line="5" />
</state> </state>
</provider> </provider>
</entry> </entry>
......
...@@ -45,8 +45,8 @@ if __name__ == "__main__": ...@@ -45,8 +45,8 @@ if __name__ == "__main__":
logging.info("comment answer one") logging.info("comment answer one")
numtime1, numtime2 = time_conv(5, 0) numtime1, numtime2 = time_conv(5, 0)
user_id = get_data(numtime1, numtime2) user_id = get_data(numtime1, numtime2)
redis_key1 = "cybertron:set_reply_id:five1" redis_key1 = "cybertron:set_reply_id:one1"
redis_key2 = "cybertron:set_reply_id:five2" redis_key2 = "cybertron:set_reply_id:one2"
reply_data_comment = [] reply_data_comment = []
if user_id: if user_id:
for i in user_id: for i in user_id:
......
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())
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())
...@@ -7,8 +7,8 @@ from auto_request import set_reply_to_redis, reply2, login ...@@ -7,8 +7,8 @@ from auto_request import set_reply_to_redis, reply2, login
if __name__ == "__main__": if __name__ == "__main__":
try: try:
redis_key1 = "cybertron:set_reply_id:five1" redis_key1 = "cybertron:set_reply_id:one1"
redis_key2 = "cybertron:set_reply_id:five2" redis_key2 = "cybertron:set_reply_id:one2"
redis_client = set_reply_to_redis() redis_client = set_reply_to_redis()
......
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())
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())
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment