Commit 9afbd4e0 authored by lixiaofang's avatar lixiaofang

add

parent 8d9faa86
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<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 beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/answer_reply1.py" beforeDir="false" afterPath="$PROJECT_DIR$/answer_reply1.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/reply_comment1.py" beforeDir="false" afterPath="$PROJECT_DIR$/reply_comment1.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
......@@ -11,26 +15,26 @@
<session id="-334786743">
<usages-collector id="statistics.file.extensions.open">
<counts>
<entry key="py" value="17" />
<entry key="py" value="18" />
<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="17" />
<entry key="Python" value="18" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.edit">
<counts>
<entry key="dummy" value="1" />
<entry key="py" value="903" />
<entry key="py" value="975" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.edit">
<counts>
<entry key="PLAIN_TEXT" value="1" />
<entry key="Python" value="903" />
<entry key="Python" value="975" />
</counts>
</usages-collector>
</session>
......@@ -40,8 +44,8 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/auto_request.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1232">
<caret line="382" column="12" lean-forward="true" selection-start-line="382" selection-start-column="12" selection-end-line="382" selection-end-column="12" />
<state relative-caret-position="358">
<caret line="153" column="19" lean-forward="true" selection-start-line="153" selection-start-column="19" selection-end-line="153" selection-end-column="19" />
<folding>
<element signature="e#0#15#0" expanded="true" />
<marker date="1562834794000" expanded="true" signature="9392:9397" ph="..." />
......@@ -53,17 +57,17 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/answer_reply2.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="223">
<caret line="62" column="23" selection-start-line="62" selection-start-column="23" selection-end-line="62" selection-end-column="23" />
<state relative-caret-position="247">
<caret line="52" column="54" lean-forward="true" selection-start-line="52" selection-start-column="54" selection-end-line="52" selection-end-column="54" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/answer_reply1.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="487">
<caret line="75" lean-forward="true" selection-start-line="75" selection-end-line="75" />
<state relative-caret-position="399">
<caret line="65" lean-forward="true" selection-start-line="65" selection-end-line="65" />
<folding>
<element signature="e#0#14#0" expanded="true" />
</folding>
......@@ -71,11 +75,23 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/reply_comment1.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="240">
<caret line="16" column="60" lean-forward="true" selection-start-line="16" selection-start-column="60" selection-end-line="16" selection-end-column="60" />
<folding>
<element signature="e#0#16#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/reply_comment2.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="240">
<caret line="20" lean-forward="true" selection-start-line="20" selection-end-line="20" />
<state relative-caret-position="75">
<caret line="9" column="48" selection-start-line="9" selection-start-column="48" selection-end-line="9" selection-end-column="48" />
</state>
</provider>
</entry>
......@@ -83,8 +99,8 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/answer_reply3.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="330">
<caret line="28" column="40" selection-start-line="28" selection-start-column="40" selection-end-line="28" selection-end-column="40" />
<state relative-caret-position="352">
<caret line="58" column="57" selection-start-line="58" selection-start-column="57" selection-end-line="58" selection-end-column="57" />
</state>
</provider>
</entry>
......@@ -122,12 +138,12 @@
<option value="$PROJECT_DIR$/answer1.txt" />
<option value="$PROJECT_DIR$/auto_request.py" />
<option value="$PROJECT_DIR$/answer_reply.py" />
<option value="$PROJECT_DIR$/reply_comment1.py" />
<option value="$PROJECT_DIR$/reply_comment3.py" />
<option value="$PROJECT_DIR$/reply_comment2.py" />
<option value="$PROJECT_DIR$/answer_reply3.py" />
<option value="$PROJECT_DIR$/reply_comment3.py" />
<option value="$PROJECT_DIR$/answer_reply2.py" />
<option value="$PROJECT_DIR$/answer_reply1.py" />
<option value="$PROJECT_DIR$/reply_comment1.py" />
</list>
</option>
</component>
......@@ -214,7 +230,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.1985703" />
<window_info active="true" content_ui="combo" id="Project" order="2" sideWeight="0.7872763" visible="true" weight="0.08816521" />
<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" />
......@@ -224,7 +240,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 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="Python Console" order="10" />
<window_info anchor="bottom" id="DB Execution Console" order="11" />
......@@ -426,48 +442,48 @@
</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="150">
<caret line="10" column="49" selection-start-line="10" selection-start-column="49" selection-end-line="10" selection-end-column="49" />
<folding>
<element signature="e#0#16#0" expanded="true" />
</folding>
<state relative-caret-position="352">
<caret line="58" column="57" selection-start-line="58" selection-start-column="57" selection-end-line="58" selection-end-column="57" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/reply_comment2.py">
<entry file="file://$PROJECT_DIR$/reply_comment3.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="240">
<caret line="20" lean-forward="true" selection-start-line="20" selection-end-line="20" />
<state relative-caret-position="270">
<caret line="22" lean-forward="true" selection-start-line="22" selection-end-line="22" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/reply_comment3.py">
<entry file="file://$PROJECT_DIR$/answer_reply2.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="270">
<caret line="22" lean-forward="true" selection-start-line="22" selection-end-line="22" />
<state relative-caret-position="247">
<caret line="52" column="54" lean-forward="true" selection-start-line="52" selection-start-column="54" selection-end-line="52" selection-end-column="54" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/answer_reply3.py">
<entry file="file://$PROJECT_DIR$/reply_comment2.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="330">
<caret line="28" column="40" selection-start-line="28" selection-start-column="40" selection-end-line="28" selection-end-column="40" />
<state relative-caret-position="75">
<caret line="9" column="48" selection-start-line="9" selection-start-column="48" selection-end-line="9" selection-end-column="48" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/answer_reply2.py">
<entry file="file://$PROJECT_DIR$/answer_reply1.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="223">
<caret line="62" column="23" selection-start-line="62" selection-start-column="23" selection-end-line="62" selection-end-column="23" />
<state relative-caret-position="399">
<caret line="65" lean-forward="true" selection-start-line="65" selection-end-line="65" />
<folding>
<element signature="e#0#14#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/auto_request.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1232">
<caret line="382" column="12" lean-forward="true" selection-start-line="382" selection-start-column="12" selection-end-line="382" selection-end-column="12" />
<state relative-caret-position="358">
<caret line="153" column="19" lean-forward="true" selection-start-line="153" selection-start-column="19" selection-end-line="153" selection-end-column="19" />
<folding>
<element signature="e#0#15#0" expanded="true" />
<marker date="1562834794000" expanded="true" signature="9392:9397" ph="..." />
......@@ -475,12 +491,12 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/answer_reply1.py">
<entry file="file://$PROJECT_DIR$/reply_comment1.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="487">
<caret line="75" lean-forward="true" selection-start-line="75" selection-end-line="75" />
<state relative-caret-position="240">
<caret line="16" column="60" lean-forward="true" selection-start-line="16" selection-start-column="60" selection-end-line="16" selection-end-column="60" />
<folding>
<element signature="e#0#14#0" expanded="true" />
<element signature="e#0#16#0" expanded="true" />
</folding>
</state>
</provider>
......
......@@ -44,8 +44,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:one1"
redis_key2 = "cybertron:set_reply_id:one2"
redis_key1 = "cybertron:set_reply_id:one"
# redis_key2 = "cybertron:set_reply_id:one2"
reply_data_comment = []
if user_id:
for i in user_id:
......@@ -61,15 +61,6 @@ if __name__ == "__main__":
{"id": reply_id, "reply_user_id": reply_user_id, "answer": comment2, "topic_id": i[1]})
redis_client = set_reply_to_redis()
have_reply = redis_client.get(redis_key1)
if have_reply:
result = json.loads(str(have_reply, encoding="utf-8"))
if result:
redis_client.set(redis_key2, json.dumps(reply_data_comment))
else:
redis_client.set(redis_key1, json.dumps(reply_data_comment))
else:
redis_client.set(redis_key1, json.dumps(reply_data_comment))
redis_client.hset(redis_key1, str(numtime1), reply_data_comment)
except:
logging.error("catch exception,main:%s" % traceback.format_exc())
......@@ -2,29 +2,22 @@ import traceback
import redis
import logging
import json
import datetime
from auto_request import set_reply_to_redis, reply2, login
if __name__ == "__main__":
try:
redis_key1 = "cybertron:set_reply_id:one1"
redis_key2 = "cybertron:set_reply_id:one2"
now = datetime.datetime.now().minute
redis_key1 = "cybertron:set_reply_id:one"
redis_client = set_reply_to_redis()
have_reply1 = redis_client.get(redis_key1)
have_reply1 = redis_client.hget(redis_key1, now - 5)
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)
else:
have_reply2 = redis_client.get(redis_key2)
result = json.loads(str(have_reply2, encoding="utf-8"))
for item in result:
cook = login()
reply2(cook, item["topic_id"], item["answer"], item["id"])
redis_client.delete(redis_key2)
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