add save/load and view response
This commit is contained in:
parent
3785698e2c
commit
a6a1ad51d7
BIN
__pycache__/mainwindow.cpython-36.pyc
Normal file
BIN
__pycache__/mainwindow.cpython-36.pyc
Normal file
Binary file not shown.
BIN
__pycache__/source_rc.cpython-36.pyc
Normal file
BIN
__pycache__/source_rc.cpython-36.pyc
Normal file
Binary file not shown.
111
app.py
111
app.py
@ -9,6 +9,12 @@ import json, requests, os, random, pyperclip, traceback, vk_api
|
||||
|
||||
history_requests = list()
|
||||
request_status = list()
|
||||
history_responses = list()
|
||||
|
||||
try:
|
||||
os.mkdir('saves');
|
||||
except Exception as exc:
|
||||
pass
|
||||
|
||||
|
||||
def genToken(lenght=32, dictonary='0123456789abcdef'):
|
||||
@ -43,7 +49,12 @@ class callback_server(Thread):
|
||||
}
|
||||
request_status.append(0)
|
||||
history_requests.append(r_body)
|
||||
history_responses.append('<p>Ждём ответа от сервера...</p>')
|
||||
r = requests.post(server_url, json=r_body)
|
||||
try:
|
||||
history_responses[history_requests.index(r_body)] = r.text
|
||||
except:
|
||||
history_responses[history_requests.index(r_body)] = f"<p>Ошибка сервера: {r.statusCode}</p>"
|
||||
if r.text != ret_str:
|
||||
request_status[history_requests.index(r_body)] = -1
|
||||
exc = callback_clientException('Invalid response code')
|
||||
@ -83,8 +94,14 @@ class callback_server(Thread):
|
||||
}
|
||||
request_status.append(0)
|
||||
history_requests.append(r_body)
|
||||
history_responses.append('<p>Ждём ответа от сервера...</p>')
|
||||
try:
|
||||
r = requests.post(self.server_url, json=r_body)
|
||||
try:
|
||||
history_responses[history_requests.index(r_body)] = r.text
|
||||
except:
|
||||
history_responses[history_requests.index(r_body)] = f"<p>Ошибка сервера: {r.statusCode}</p>"
|
||||
|
||||
if r.text != 'ok':
|
||||
request_status[history_requests.index(r_body)] = -1
|
||||
else:
|
||||
@ -113,6 +130,18 @@ class app_win(QMainWindow):
|
||||
self.ui.setupUi(self)
|
||||
self.setMouseTracking(True)
|
||||
self.callback_server = callback_server()
|
||||
|
||||
self.saves = list()
|
||||
|
||||
for root, dirs, files in os.walk('saves'):
|
||||
for _dir in dirs:
|
||||
files_in_dir = list()
|
||||
for _root, _dirs, _files in os.walk(f"saves/{_dir}"):
|
||||
for file in _files:
|
||||
files_in_dir.append(file)
|
||||
if ('group_id.txt' in files_in_dir) and ('ret_str.txt' in files_in_dir) and ('secret_key.txt' in files_in_dir) and ('server_url.txt' in files_in_dir) and ('token.txt' in files_in_dir):
|
||||
self.saves.append(_dir)
|
||||
self.ui.saveList.addItem(_dir)
|
||||
|
||||
# Other
|
||||
retStr_file = open('ret_str.txt', 'r', encoding='utf-8')
|
||||
@ -154,6 +183,85 @@ class app_win(QMainWindow):
|
||||
self.ui.copy_ret_str.clicked.connect(lambda: pyperclip.copy(self.ret_str))
|
||||
self.ui.gen_ret_str.clicked.connect(self.generate_returnString)
|
||||
self.ui.start.clicked.connect(self.connect_callback)
|
||||
self.ui.new_saveButton.clicked.connect(self.new_saveSession)
|
||||
self.ui.loadButton.clicked.connect(self.loadSession)
|
||||
self.ui.saveButton.clicked.connect(self.saveSession)
|
||||
|
||||
def loadSession(self):
|
||||
text = self.ui.saveList.currentText()
|
||||
with open('group_id.txt', 'wb') as f:
|
||||
with open(f"saves/{text}/group_id.txt", 'rb') as fs:
|
||||
content = fs.read()
|
||||
f.write(content)
|
||||
self.ui.group_idInput.setText(content.decode("utf-8"))
|
||||
with open('ret_str.txt', 'wb') as f:
|
||||
with open(f"saves/{text}/ret_str.txt", 'rb') as fs:
|
||||
content = fs.read()
|
||||
f.write(content)
|
||||
self.ui.ret_str.setText(f"Строка, которую должен вернуть сервер: {content.decode('utf-8')}")
|
||||
with open('secret_key.txt', 'wb') as f:
|
||||
with open(f"saves/{text}/secret_key.txt", 'rb') as fs:
|
||||
content = fs.read()
|
||||
f.write(content)
|
||||
self.ui.secret_key.setText(content.decode('utf-8'))
|
||||
with open('server_url.txt', 'wb') as f:
|
||||
with open(f"saves/{text}/server_url.txt", 'rb') as fs:
|
||||
content = fs.read()
|
||||
f.write(content)
|
||||
self.ui.server_url.setText(content.decode('utf-8'))
|
||||
with open('token.txt', 'wb') as f:
|
||||
with open(f"saves/{text}/token.txt", 'rb') as fs:
|
||||
content = fs.read()
|
||||
f.write(content)
|
||||
self.ui.group_token.setText(content.decode('utf-8'))
|
||||
|
||||
def saveSession(self):
|
||||
text = self.ui.saveList.currentText()
|
||||
if True:
|
||||
try:
|
||||
with open('group_id.txt', 'rb') as f:
|
||||
with open(f"saves/{text}/group_id.txt", 'wb') as fs:
|
||||
fs.write(f.read())
|
||||
with open('ret_str.txt', 'rb') as f:
|
||||
with open(f"saves/{text}/ret_str.txt", 'wb') as fs:
|
||||
fs.write(f.read())
|
||||
with open('secret_key.txt', 'rb') as f:
|
||||
with open(f"saves/{text}/secret_key.txt", 'wb') as fs:
|
||||
fs.write(f.read())
|
||||
with open('server_url.txt', 'rb') as f:
|
||||
with open(f"saves/{text}/server_url.txt", 'wb') as fs:
|
||||
fs.write(f.read())
|
||||
with open('token.txt', 'rb') as f:
|
||||
with open(f"saves/{text}/token.txt", 'wb') as fs:
|
||||
fs.write(f.read())
|
||||
except Exception as exc:
|
||||
pass
|
||||
|
||||
def new_saveSession(self):
|
||||
text, ok = QInputDialog.getText(self, 'Сохранить сессию', 'Введите имя сессии:')
|
||||
if ok and not(text in self.saves):
|
||||
try:
|
||||
os.mkdir(f"saves/{text}")
|
||||
with open('group_id.txt', 'rb') as f:
|
||||
with open(f"saves/{text}/group_id.txt", 'wb') as fs:
|
||||
fs.write(f.read())
|
||||
with open('ret_str.txt', 'rb') as f:
|
||||
with open(f"saves/{text}/ret_str.txt", 'wb') as fs:
|
||||
fs.write(f.read())
|
||||
with open('secret_key.txt', 'rb') as f:
|
||||
with open(f"saves/{text}/secret_key.txt", 'wb') as fs:
|
||||
fs.write(f.read())
|
||||
with open('server_url.txt', 'rb') as f:
|
||||
with open(f"saves/{text}/server_url.txt", 'wb') as fs:
|
||||
fs.write(f.read())
|
||||
with open('token.txt', 'rb') as f:
|
||||
with open(f"saves/{text}/token.txt", 'wb') as fs:
|
||||
fs.write(f.read())
|
||||
|
||||
self.saves.append(text)
|
||||
self.ui.saveList.addItem(text)
|
||||
except Exception as exc:
|
||||
pass
|
||||
|
||||
def update_info_requests(self):
|
||||
global history_requests, request_status
|
||||
@ -173,6 +281,8 @@ class app_win(QMainWindow):
|
||||
|
||||
def qTimer_void(self):
|
||||
global history_requests, request_status
|
||||
self.ui.loadButton.setEnabled(len(self.saves) > 0)
|
||||
self.ui.saveButton.setEnabled(len(self.saves) > 0)
|
||||
self.ui.start.setEnabled(bool(self.ui.server_url.text()) and bool(self.ui.group_idInput.text()) and bool(self.ui.group_token.text()) and not(self.connected))
|
||||
if self.parsed_requests != history_requests or self.parsed_responses != request_status:
|
||||
self.update_info_requests()
|
||||
@ -184,6 +294,7 @@ class app_win(QMainWindow):
|
||||
if self.json_code_view != JSON_CONTENT:
|
||||
self.json_code_view = JSON_CONTENT
|
||||
self.ui.requestBody.setText(self.json_code_view)
|
||||
self.ui.responseBody.setText(history_responses[self.ui.requestsWidget.currentRow()])
|
||||
if self.ui.group_idInput.text() != filtrating_integer(self.ui.group_idInput.text()):
|
||||
self.ui.group_idInput.setText(filtrating_integer(self.ui.group_idInput.text()))
|
||||
|
||||
|
585
main.ui
585
main.ui
@ -1,244 +1,341 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>631</width>
|
||||
<height>557</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>631</width>
|
||||
<height>557</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>631</width>
|
||||
<height>557</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Генератор callback запросов</string>
|
||||
</property>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>601</width>
|
||||
<height>151</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Информация о сервере</string>
|
||||
</property>
|
||||
<widget class="QLineEdit" name="server_url">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>30</y>
|
||||
<width>261</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>url сервера</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>50</y>
|
||||
<width>251</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Секретный ключ</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="secret_key">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>70</y>
|
||||
<width>261</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>aaQ13axAPQEcczQa</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="ret_str">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>290</x>
|
||||
<y>30</y>
|
||||
<width>301</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Строка, которую должен вернуть сервер: XXXXXXX</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="copy_ret_str">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>504</x>
|
||||
<y>80</y>
|
||||
<width>91</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>PointingHandCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Скопировать</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="gen_ret_str">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>410</x>
|
||||
<y>80</y>
|
||||
<width>91</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>PointingHandCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Сгенерировать</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="group_token">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>120</y>
|
||||
<width>261</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="echoMode">
|
||||
<enum>QLineEdit::Password</enum>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>токен группы</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="group_idInput">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>100</y>
|
||||
<width>261</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>id группы</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="start">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>530</x>
|
||||
<y>520</y>
|
||||
<width>75</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>PointingHandCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Запуск</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>160</y>
|
||||
<width>311</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p align="center">Запросы</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QListWidget" name="requestsWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>180</y>
|
||||
<width>311</width>
|
||||
<height>331</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTextBrowser" name="requestBody">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>320</x>
|
||||
<y>180</y>
|
||||
<width>291</width>
|
||||
<height>331</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="cursor" stdset="0">
|
||||
<cursorShape>IBeamCursor</cursorShape>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>320</x>
|
||||
<y>160</y>
|
||||
<width>291</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p align="center">Тело запроса</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="work_status">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>406</x>
|
||||
<y>520</y>
|
||||
<width>121</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><img src=":/response_codes/Sending.png"/> Сервер не запущен</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="source.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>631</width>
|
||||
<height>557</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>631</width>
|
||||
<height>557</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>631</width>
|
||||
<height>557</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Генератор callback запросов</string>
|
||||
</property>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>601</width>
|
||||
<height>151</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Информация о сервере</string>
|
||||
</property>
|
||||
<widget class="QLineEdit" name="server_url">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>30</y>
|
||||
<width>261</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>url сервера</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>50</y>
|
||||
<width>251</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Секретный ключ</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="secret_key">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>70</y>
|
||||
<width>261</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>aaQ13axAPQEcczQa</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="ret_str">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>290</x>
|
||||
<y>30</y>
|
||||
<width>301</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Строка, которую должен вернуть сервер: XXXXXXX</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="copy_ret_str">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>500</x>
|
||||
<y>60</y>
|
||||
<width>91</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>PointingHandCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Скопировать</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="gen_ret_str">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>410</x>
|
||||
<y>60</y>
|
||||
<width>91</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>PointingHandCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Сгенерировать</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="group_token">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>120</y>
|
||||
<width>261</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="echoMode">
|
||||
<enum>QLineEdit::Password</enum>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>токен группы</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="group_idInput">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>100</y>
|
||||
<width>261</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>id группы</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QComboBox" name="saveList">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>290</x>
|
||||
<y>120</y>
|
||||
<width>131</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="loadButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>520</x>
|
||||
<y>120</y>
|
||||
<width>71</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>PointingHandCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Загрузить</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="new_saveButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>420</x>
|
||||
<y>120</y>
|
||||
<width>101</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>PointingHandCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Сохранить как</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="saveButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>520</x>
|
||||
<y>100</y>
|
||||
<width>71</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>PointingHandCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Сохранить</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="start">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>530</x>
|
||||
<y>520</y>
|
||||
<width>75</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>PointingHandCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Запуск</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>160</y>
|
||||
<width>311</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p align="center">Запросы</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QListWidget" name="requestsWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>180</y>
|
||||
<width>311</width>
|
||||
<height>331</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTextBrowser" name="requestBody">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>320</x>
|
||||
<y>180</y>
|
||||
<width>291</width>
|
||||
<height>191</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="cursor" stdset="0">
|
||||
<cursorShape>IBeamCursor</cursorShape>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>320</x>
|
||||
<y>160</y>
|
||||
<width>291</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p align="center">Тело запроса</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="work_status">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>406</x>
|
||||
<y>520</y>
|
||||
<width>121</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><img src=":/response_codes/Sending.png"/> Сервер не запущен</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>320</x>
|
||||
<y>370</y>
|
||||
<width>291</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p align="center">Ответ</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTextBrowser" name="responseBody">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>320</x>
|
||||
<y>390</y>
|
||||
<width>291</width>
|
||||
<height>121</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="cursor" stdset="0">
|
||||
<cursorShape>IBeamCursor</cursorShape>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="source.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
223
mainwindow.py
223
mainwindow.py
@ -1,95 +1,128 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'main.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.15.2
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(631, 557)
|
||||
Form.setMinimumSize(QtCore.QSize(631, 557))
|
||||
Form.setMaximumSize(QtCore.QSize(631, 557))
|
||||
self.groupBox = QtWidgets.QGroupBox(Form)
|
||||
self.groupBox.setGeometry(QtCore.QRect(10, 10, 601, 151))
|
||||
self.groupBox.setObjectName("groupBox")
|
||||
self.server_url = QtWidgets.QLineEdit(self.groupBox)
|
||||
self.server_url.setGeometry(QtCore.QRect(20, 30, 261, 20))
|
||||
self.server_url.setObjectName("server_url")
|
||||
self.label = QtWidgets.QLabel(self.groupBox)
|
||||
self.label.setGeometry(QtCore.QRect(20, 50, 251, 16))
|
||||
self.label.setObjectName("label")
|
||||
self.secret_key = QtWidgets.QLineEdit(self.groupBox)
|
||||
self.secret_key.setGeometry(QtCore.QRect(20, 70, 261, 20))
|
||||
self.secret_key.setObjectName("secret_key")
|
||||
self.ret_str = QtWidgets.QLabel(self.groupBox)
|
||||
self.ret_str.setGeometry(QtCore.QRect(290, 30, 301, 41))
|
||||
self.ret_str.setObjectName("ret_str")
|
||||
self.copy_ret_str = QtWidgets.QPushButton(self.groupBox)
|
||||
self.copy_ret_str.setGeometry(QtCore.QRect(504, 80, 91, 23))
|
||||
self.copy_ret_str.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
|
||||
self.copy_ret_str.setObjectName("copy_ret_str")
|
||||
self.gen_ret_str = QtWidgets.QPushButton(self.groupBox)
|
||||
self.gen_ret_str.setGeometry(QtCore.QRect(410, 80, 91, 23))
|
||||
self.gen_ret_str.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
|
||||
self.gen_ret_str.setObjectName("gen_ret_str")
|
||||
self.group_token = QtWidgets.QLineEdit(self.groupBox)
|
||||
self.group_token.setGeometry(QtCore.QRect(20, 120, 261, 20))
|
||||
self.group_token.setEchoMode(QtWidgets.QLineEdit.Password)
|
||||
self.group_token.setObjectName("group_token")
|
||||
self.group_idInput = QtWidgets.QLineEdit(self.groupBox)
|
||||
self.group_idInput.setGeometry(QtCore.QRect(20, 100, 261, 20))
|
||||
self.group_idInput.setObjectName("group_idInput")
|
||||
self.start = QtWidgets.QPushButton(Form)
|
||||
self.start.setGeometry(QtCore.QRect(530, 520, 75, 23))
|
||||
self.start.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
|
||||
self.start.setObjectName("start")
|
||||
self.label_2 = QtWidgets.QLabel(Form)
|
||||
self.label_2.setGeometry(QtCore.QRect(10, 160, 311, 21))
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.requestsWidget = QtWidgets.QListWidget(Form)
|
||||
self.requestsWidget.setGeometry(QtCore.QRect(10, 180, 311, 331))
|
||||
self.requestsWidget.setObjectName("requestsWidget")
|
||||
self.requestBody = QtWidgets.QTextBrowser(Form)
|
||||
self.requestBody.setGeometry(QtCore.QRect(320, 180, 291, 331))
|
||||
self.requestBody.viewport().setProperty("cursor", QtGui.QCursor(QtCore.Qt.IBeamCursor))
|
||||
self.requestBody.setObjectName("requestBody")
|
||||
self.label_3 = QtWidgets.QLabel(Form)
|
||||
self.label_3.setGeometry(QtCore.QRect(320, 160, 291, 21))
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.work_status = QtWidgets.QLabel(Form)
|
||||
self.work_status.setGeometry(QtCore.QRect(406, 520, 121, 21))
|
||||
self.work_status.setObjectName("work_status")
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "Генератор callback запросов"))
|
||||
self.groupBox.setTitle(_translate("Form", "Информация о сервере"))
|
||||
self.server_url.setPlaceholderText(_translate("Form", "url сервера"))
|
||||
self.label.setText(_translate("Form", "Секретный ключ"))
|
||||
self.secret_key.setPlaceholderText(_translate("Form", "aaQ13axAPQEcczQa"))
|
||||
self.ret_str.setText(_translate("Form", "Строка, которую должен вернуть сервер: XXXXXXX"))
|
||||
self.copy_ret_str.setText(_translate("Form", "Скопировать"))
|
||||
self.gen_ret_str.setText(_translate("Form", "Сгенерировать"))
|
||||
self.group_token.setPlaceholderText(_translate("Form", "токен группы"))
|
||||
self.group_idInput.setPlaceholderText(_translate("Form", "id группы"))
|
||||
self.start.setText(_translate("Form", "Запуск"))
|
||||
self.label_2.setText(_translate("Form", "<html><head/><body><p align=\"center\">Запросы</p></body></html>"))
|
||||
self.requestBody.setHtml(_translate("Form", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
|
||||
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
|
||||
"p, li { white-space: pre-wrap; }\n"
|
||||
"</style></head><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n"
|
||||
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p></body></html>"))
|
||||
self.label_3.setText(_translate("Form", "<html><head/><body><p align=\"center\">Тело запроса</p></body></html>"))
|
||||
self.work_status.setText(_translate("Form", "<html><head/><body><p><img src=\":/response_codes/Sending.png\"/> Сервер не запущен</p></body></html>"))
|
||||
import source_rc
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'main.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.15.2
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(631, 557)
|
||||
Form.setMinimumSize(QtCore.QSize(631, 557))
|
||||
Form.setMaximumSize(QtCore.QSize(631, 557))
|
||||
self.groupBox = QtWidgets.QGroupBox(Form)
|
||||
self.groupBox.setGeometry(QtCore.QRect(10, 10, 601, 151))
|
||||
self.groupBox.setObjectName("groupBox")
|
||||
self.server_url = QtWidgets.QLineEdit(self.groupBox)
|
||||
self.server_url.setGeometry(QtCore.QRect(20, 30, 261, 20))
|
||||
self.server_url.setObjectName("server_url")
|
||||
self.label = QtWidgets.QLabel(self.groupBox)
|
||||
self.label.setGeometry(QtCore.QRect(20, 50, 251, 16))
|
||||
self.label.setObjectName("label")
|
||||
self.secret_key = QtWidgets.QLineEdit(self.groupBox)
|
||||
self.secret_key.setGeometry(QtCore.QRect(20, 70, 261, 20))
|
||||
self.secret_key.setObjectName("secret_key")
|
||||
self.ret_str = QtWidgets.QLabel(self.groupBox)
|
||||
self.ret_str.setGeometry(QtCore.QRect(290, 30, 301, 21))
|
||||
self.ret_str.setObjectName("ret_str")
|
||||
self.copy_ret_str = QtWidgets.QPushButton(self.groupBox)
|
||||
self.copy_ret_str.setGeometry(QtCore.QRect(500, 60, 91, 23))
|
||||
self.copy_ret_str.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
|
||||
self.copy_ret_str.setObjectName("copy_ret_str")
|
||||
self.gen_ret_str = QtWidgets.QPushButton(self.groupBox)
|
||||
self.gen_ret_str.setGeometry(QtCore.QRect(410, 60, 91, 23))
|
||||
self.gen_ret_str.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
|
||||
self.gen_ret_str.setObjectName("gen_ret_str")
|
||||
self.group_token = QtWidgets.QLineEdit(self.groupBox)
|
||||
self.group_token.setGeometry(QtCore.QRect(20, 120, 261, 20))
|
||||
self.group_token.setEchoMode(QtWidgets.QLineEdit.Password)
|
||||
self.group_token.setObjectName("group_token")
|
||||
self.group_idInput = QtWidgets.QLineEdit(self.groupBox)
|
||||
self.group_idInput.setGeometry(QtCore.QRect(20, 100, 261, 20))
|
||||
self.group_idInput.setObjectName("group_idInput")
|
||||
self.saveList = QtWidgets.QComboBox(self.groupBox)
|
||||
self.saveList.setGeometry(QtCore.QRect(290, 120, 131, 22))
|
||||
self.saveList.setObjectName("saveList")
|
||||
self.loadButton = QtWidgets.QPushButton(self.groupBox)
|
||||
self.loadButton.setEnabled(False)
|
||||
self.loadButton.setGeometry(QtCore.QRect(520, 120, 71, 23))
|
||||
self.loadButton.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
|
||||
self.loadButton.setObjectName("loadButton")
|
||||
self.new_saveButton = QtWidgets.QPushButton(self.groupBox)
|
||||
self.new_saveButton.setGeometry(QtCore.QRect(420, 120, 101, 23))
|
||||
self.new_saveButton.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
|
||||
self.new_saveButton.setObjectName("new_saveButton")
|
||||
self.saveButton = QtWidgets.QPushButton(self.groupBox)
|
||||
self.saveButton.setEnabled(False)
|
||||
self.saveButton.setGeometry(QtCore.QRect(520, 100, 71, 23))
|
||||
self.saveButton.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
|
||||
self.saveButton.setObjectName("saveButton")
|
||||
self.start = QtWidgets.QPushButton(Form)
|
||||
self.start.setGeometry(QtCore.QRect(530, 520, 75, 23))
|
||||
self.start.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
|
||||
self.start.setObjectName("start")
|
||||
self.label_2 = QtWidgets.QLabel(Form)
|
||||
self.label_2.setGeometry(QtCore.QRect(10, 160, 311, 21))
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.requestsWidget = QtWidgets.QListWidget(Form)
|
||||
self.requestsWidget.setGeometry(QtCore.QRect(10, 180, 311, 331))
|
||||
self.requestsWidget.setObjectName("requestsWidget")
|
||||
self.requestBody = QtWidgets.QTextBrowser(Form)
|
||||
self.requestBody.setGeometry(QtCore.QRect(320, 180, 291, 191))
|
||||
self.requestBody.viewport().setProperty("cursor", QtGui.QCursor(QtCore.Qt.IBeamCursor))
|
||||
self.requestBody.setObjectName("requestBody")
|
||||
self.label_3 = QtWidgets.QLabel(Form)
|
||||
self.label_3.setGeometry(QtCore.QRect(320, 160, 291, 21))
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.work_status = QtWidgets.QLabel(Form)
|
||||
self.work_status.setGeometry(QtCore.QRect(406, 520, 121, 21))
|
||||
self.work_status.setObjectName("work_status")
|
||||
self.label_4 = QtWidgets.QLabel(Form)
|
||||
self.label_4.setGeometry(QtCore.QRect(320, 370, 291, 21))
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.responseBody = QtWidgets.QTextBrowser(Form)
|
||||
self.responseBody.setGeometry(QtCore.QRect(320, 390, 291, 121))
|
||||
self.responseBody.viewport().setProperty("cursor", QtGui.QCursor(QtCore.Qt.IBeamCursor))
|
||||
self.responseBody.setObjectName("responseBody")
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "Генератор callback запросов"))
|
||||
self.groupBox.setTitle(_translate("Form", "Информация о сервере"))
|
||||
self.server_url.setPlaceholderText(_translate("Form", "url сервера"))
|
||||
self.label.setText(_translate("Form", "Секретный ключ"))
|
||||
self.secret_key.setPlaceholderText(_translate("Form", "aaQ13axAPQEcczQa"))
|
||||
self.ret_str.setText(_translate("Form", "Строка, которую должен вернуть сервер: XXXXXXX"))
|
||||
self.copy_ret_str.setText(_translate("Form", "Скопировать"))
|
||||
self.gen_ret_str.setText(_translate("Form", "Сгенерировать"))
|
||||
self.group_token.setPlaceholderText(_translate("Form", "токен группы"))
|
||||
self.group_idInput.setPlaceholderText(_translate("Form", "id группы"))
|
||||
self.loadButton.setText(_translate("Form", "Загрузить"))
|
||||
self.new_saveButton.setText(_translate("Form", "Сохранить как"))
|
||||
self.saveButton.setText(_translate("Form", "Сохранить"))
|
||||
self.start.setText(_translate("Form", "Запуск"))
|
||||
self.label_2.setText(_translate("Form", "<html><head/><body><p align=\"center\">Запросы</p></body></html>"))
|
||||
self.requestBody.setHtml(_translate("Form", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
|
||||
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
|
||||
"p, li { white-space: pre-wrap; }\n"
|
||||
"</style></head><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n"
|
||||
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p></body></html>"))
|
||||
self.label_3.setText(_translate("Form", "<html><head/><body><p align=\"center\">Тело запроса</p></body></html>"))
|
||||
self.work_status.setText(_translate("Form", "<html><head/><body><p><img src=\":/response_codes/Sending.png\"/> Сервер не запущен</p></body></html>"))
|
||||
self.label_4.setText(_translate("Form", "<html><head/><body><p align=\"center\">Ответ</p></body></html>"))
|
||||
self.responseBody.setHtml(_translate("Form", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
|
||||
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
|
||||
"p, li { white-space: pre-wrap; }\n"
|
||||
"</style></head><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n"
|
||||
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p></body></html>"))
|
||||
import source_rc
|
||||
|
@ -0,0 +1 @@
|
||||
f1d39232
|
Loading…
Reference in New Issue
Block a user