master
WuXianChaoPin 6 years ago
parent 972e42fa36
commit ba24e22147
  1. 6
      PixivSearch/templates/index.html
  2. 4
      PixivSearch/thrift/TestQry/Client.py
  3. 4
      PixivSearch/thrift/TestQry/Server.py
  4. 7
      PixivSearch/thrift/TestQry/TestQry-remote
  5. 2
      PixivSearch/thrift/TestQry/TestQry.py
  6. 2
      root.ini
  7. 11
      root.py

@ -31,13 +31,13 @@
<label>关键字<input name="word" placeholder="R-18"/></label>
<label>页数<input name="pageSize" type="number" placeholder="10"/></label>
<label>排行数<input name="order" type="number" placeholder="10"/></label>
<label>结果显示类型:文本信息<input type="radio" value="" name="type" checked/></label>
<label>图文信息<input type="radio" value="img" name="type"/></label>
<input type="hidden" name="type" value=""/>
{# <label>结果显示类型:文本信息<input type="radio" value="" name="type" checked/></label>#}
{# <label>图文信息<input type="radio" value="img" name="type"/></label>#}
<input type="submit" />
{% if download %}
<a href="{% static "/download/" %}{{download}}">图包提取(文件大小:{{ size}})</a>
{# <button id="download" onclick="window.open('{% static "/download/" %}{{download}}')">图包提取(文件大小:{{ size}})</button>#}
{% endif %}
</form>

@ -3,12 +3,12 @@ import sys
from thrift.protocol import TBinaryProtocol
from thrift.transport import TSocket, TTransport
sys.path.append("/home/hua/PycharmProjects/PixivSearch")
sys.path.append('/root/PixivSearch')
from PixivSearch.thrift.TestQry.TestQry import Client
if __name__ == '__main__':
# Make socket
socket = TSocket.TSocket('127.0.0.1', 2233)
socket = TSocket.TSocket('mikuhime.xyz', 2233)
# Buffering is critical. Raw sockets are very slow
transport = TTransport.TFramedTransport(socket)

@ -1,6 +1,9 @@
import sys
from thrift.server.TNonblockingServer import TNonblockingServer
from thrift.transport import TSocket
sys.path.append('/root/PixivSearch')
from PixivSearch.thrift.TestQry import TestQry
from PixivSearch.thrift.TestQry.ttypes import QryResult
@ -12,6 +15,7 @@ class QueryImpl(TestQry.Iface):
if qryCode == 1:
result.code = 1
result.msg = 'success'
else:
result.code = 0
result.msg = 'fail'

@ -10,8 +10,11 @@
import sys
import pprint
from urllib.parse import urlparse
sys.path.append("/home/hua/PycharmProjects/PixivSearch")
from PixivSearch.thrift import TestQry
from PixivSearch.thrift.TestQry import TestQry
sys.path.append('/root/PixivSearch')
from thrift.transport import TTransport, TSocket, TSSLSocket, THttpClient
from thrift.protocol.TBinaryProtocol import TBinaryProtocol

@ -16,8 +16,6 @@ from PixivSearch.thrift.TestQry.ttypes import QryResult
all_structs = []
port=2233
class Iface(object):
def qryTest(self, qryCode):
"""

@ -0,0 +1,2 @@
[config]
bastPath=/root/PixivSearch

@ -0,0 +1,11 @@
import configparser
cf = configparser.ConfigParser()
cf.read('root.ini')
def getConfigValue(name):
value = cf.get("config", name)
return value
if __name__ == '__main__':
print(getConfigValue('bastPath'))
Loading…
Cancel
Save