Commit 9afbd4e0 authored by lixiaofang's avatar lixiaofang

add

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