Skip to content

Commit

Permalink
update 210425
Browse files Browse the repository at this point in the history
  • Loading branch information
kdrkdrkdr committed Apr 25, 2021
1 parent 0e61a2a commit d112eb9
Show file tree
Hide file tree
Showing 13 changed files with 598 additions and 151 deletions.
255 changes: 125 additions & 130 deletions UI_MAIN.py
Original file line number Diff line number Diff line change
@@ -1,146 +1,141 @@
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file '.\UI_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.
################################################################################
## Form generated from reading UI file 'UI_MAIN.ui'
##
## Created by: Qt User Interface Compiler version 5.15.2
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################


from PyQt5 import QtCore, QtGui, QtWidgets
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *


class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
if not MainWindow.objectName():
MainWindow.setObjectName(u"MainWindow")
MainWindow.setEnabled(True)
MainWindow.resize(631, 416)
MainWindow.setMinimumSize(QtCore.QSize(268, 167))
MainWindow.setMaximumSize(QtCore.QSize(16777215, 16777215))
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.wholeFrame = QtWidgets.QFrame(self.centralwidget)
self.wholeFrame.setGeometry(QtCore.QRect(9, 10, 611, 151))
self.wholeFrame.setFrameShape(QtWidgets.QFrame.Box)
self.wholeFrame.setFrameShadow(QtWidgets.QFrame.Raised)
self.wholeFrame.setObjectName("wholeFrame")
self.reloadBtn = QtWidgets.QPushButton(self.wholeFrame)
self.reloadBtn.setGeometry(QtCore.QRect(520, 110, 81, 28))
font = QtGui.QFont()
MainWindow.resize(632, 416)
MainWindow.setMinimumSize(QSize(268, 167))
MainWindow.setMaximumSize(QSize(16777215, 16777215))
self.centralwidget = QWidget(MainWindow)
self.centralwidget.setObjectName(u"centralwidget")
self.wholeFrame = QFrame(self.centralwidget)
self.wholeFrame.setObjectName(u"wholeFrame")
self.wholeFrame.setGeometry(QRect(9, 10, 611, 151))
self.wholeFrame.setFrameShape(QFrame.Box)
self.wholeFrame.setFrameShadow(QFrame.Raised)
self.reloadBtn = QPushButton(self.wholeFrame)
self.reloadBtn.setObjectName(u"reloadBtn")
self.reloadBtn.setGeometry(QRect(520, 110, 81, 28))
font = QFont()
font.setPointSize(11)
self.reloadBtn.setFont(font)
self.reloadBtn.setObjectName("reloadBtn")
self.window_list = QtWidgets.QComboBox(self.wholeFrame)
self.window_list.setGeometry(QtCore.QRect(9, 112, 501, 21))
self.window_list.setObjectName("window_list")
self.timeFrame = QtWidgets.QFrame(self.wholeFrame)
self.timeFrame.setGeometry(QtCore.QRect(430, 16, 171, 31))
self.timeFrame.setFrameShape(QtWidgets.QFrame.Box)
self.timeFrame.setFrameShadow(QtWidgets.QFrame.Raised)
self.timeFrame.setObjectName("timeFrame")
self.sec = QtWidgets.QLabel(self.timeFrame)
self.sec.setGeometry(QtCore.QRect(74, 1, 61, 31))
self.sec.setText("")
self.sec.setObjectName("sec")
self.trans_time = QtWidgets.QLabel(self.timeFrame)
self.trans_time.setGeometry(QtCore.QRect(13, 1, 81, 31))
self.trans_time.setObjectName("trans_time")
self.status_frame = QtWidgets.QFrame(self.wholeFrame)
self.status_frame.setGeometry(QtCore.QRect(430, 63, 171, 31))
self.status_frame.setFrameShape(QtWidgets.QFrame.Box)
self.status_frame.setFrameShadow(QtWidgets.QFrame.Raised)
self.status_frame.setObjectName("status_frame")
self.show_status = QtWidgets.QLabel(self.status_frame)
self.show_status.setGeometry(QtCore.QRect(46, 6, 101, 20))
self.show_status.setText("")
self.show_status.setObjectName("show_status")
self.status_lbl = QtWidgets.QLabel(self.status_frame)
self.status_lbl.setGeometry(QtCore.QRect(13, 8, 51, 16))
self.status_lbl.setObjectName("status_lbl")
self.btnFrame = QtWidgets.QFrame(self.wholeFrame)
self.btnFrame.setGeometry(QtCore.QRect(10, 10, 231, 91))
self.btnFrame.setFrameShape(QtWidgets.QFrame.Box)
self.btnFrame.setFrameShadow(QtWidgets.QFrame.Raised)
self.btnFrame.setObjectName("btnFrame")
self.show_ori_btn = QtWidgets.QPushButton(self.btnFrame)
self.show_ori_btn.setGeometry(QtCore.QRect(90, 5, 71, 31))
font = QtGui.QFont()
font.setFamily("Consolas")
font.setPointSize(10)
font.setBold(False)
font.setWeight(50)
self.show_ori_btn.setFont(font)
self.show_ori_btn.setObjectName("show_ori_btn")
self.show_trans_btn = QtWidgets.QPushButton(self.btnFrame)
self.show_trans_btn.setGeometry(QtCore.QRect(7, 5, 81, 31))
font = QtGui.QFont()
font.setFamily("Consolas")
font.setPointSize(10)
font.setBold(False)
font.setWeight(50)
self.show_trans_btn.setFont(font)
self.show_trans_btn.setObjectName("show_trans_btn")
self.stop_trans_btn = QtWidgets.QPushButton(self.btnFrame)
self.stop_trans_btn.setGeometry(QtCore.QRect(163, 5, 61, 31))
font = QtGui.QFont()
font.setPointSize(10)
self.stop_trans_btn.setFont(font)
self.stop_trans_btn.setObjectName("stop_trans_btn")
self.isPrintBoth = QtWidgets.QCheckBox(self.btnFrame)
self.isPrintBoth.setGeometry(QtCore.QRect(10, 37, 151, 19))
font = QtGui.QFont()
font.setPointSize(10)
self.isPrintBoth.setFont(font)
self.isPrintBoth.setObjectName("isPrintBoth")
self.isAutoTrans = QtWidgets.QCheckBox(self.btnFrame)
self.isAutoTrans.setGeometry(QtCore.QRect(10, 54, 211, 19))
font = QtGui.QFont()
font.setPointSize(10)
self.isAutoTrans.setFont(font)
self.isAutoTrans.setObjectName("isAutoTrans")
self.isPrintLog = QtWidgets.QCheckBox(self.btnFrame)
self.isPrintLog.setGeometry(QtCore.QRect(10, 71, 211, 19))
font = QtGui.QFont()
font.setPointSize(10)
self.isPrintLog.setFont(font)
self.isPrintLog.setObjectName("isPrintLog")
self.authorFrame = QtWidgets.QFrame(self.wholeFrame)
self.authorFrame.setGeometry(QtCore.QRect(250, 10, 171, 91))
self.authorFrame.setFrameShape(QtWidgets.QFrame.Box)
self.authorFrame.setFrameShadow(QtWidgets.QFrame.Raised)
self.authorFrame.setObjectName("authorFrame")
self.dev_info = QtWidgets.QLabel(self.authorFrame)
self.dev_info.setGeometry(QtCore.QRect(95, 10, 61, 71))
self.dev_info.setFrameShape(QtWidgets.QFrame.NoFrame)
self.dev_info.setObjectName("dev_info")
self.go_dev_page = QtWidgets.QPushButton(self.authorFrame)
self.go_dev_page.setGeometry(QtCore.QRect(7, 5, 75, 81))
self.go_dev_page.setObjectName("go_dev_page")
self.log_browser = QtWidgets.QTextBrowser(self.centralwidget)
self.log_browser.setGeometry(QtCore.QRect(10, 180, 611, 201))
self.log_browser.setObjectName("log_browser")
self.window_list = QComboBox(self.wholeFrame)
self.window_list.setObjectName(u"window_list")
self.window_list.setGeometry(QRect(9, 112, 501, 21))
self.timeFrame = QFrame(self.wholeFrame)
self.timeFrame.setObjectName(u"timeFrame")
self.timeFrame.setGeometry(QRect(430, 16, 171, 31))
self.timeFrame.setFrameShape(QFrame.Box)
self.timeFrame.setFrameShadow(QFrame.Raised)
self.sec = QLabel(self.timeFrame)
self.sec.setObjectName(u"sec")
self.sec.setGeometry(QRect(74, 1, 61, 31))
self.trans_time = QLabel(self.timeFrame)
self.trans_time.setObjectName(u"trans_time")
self.trans_time.setGeometry(QRect(13, 1, 81, 31))
self.status_frame = QFrame(self.wholeFrame)
self.status_frame.setObjectName(u"status_frame")
self.status_frame.setGeometry(QRect(430, 63, 171, 31))
self.status_frame.setFrameShape(QFrame.Box)
self.status_frame.setFrameShadow(QFrame.Raised)
self.show_status = QLabel(self.status_frame)
self.show_status.setObjectName(u"show_status")
self.show_status.setGeometry(QRect(46, 6, 101, 20))
self.status_lbl = QLabel(self.status_frame)
self.status_lbl.setObjectName(u"status_lbl")
self.status_lbl.setGeometry(QRect(13, 8, 51, 16))
self.btnFrame = QFrame(self.wholeFrame)
self.btnFrame.setObjectName(u"btnFrame")
self.btnFrame.setGeometry(QRect(10, 10, 231, 91))
self.btnFrame.setFrameShape(QFrame.Box)
self.btnFrame.setFrameShadow(QFrame.Raised)
self.show_ori_btn = QPushButton(self.btnFrame)
self.show_ori_btn.setObjectName(u"show_ori_btn")
self.show_ori_btn.setGeometry(QRect(90, 5, 71, 31))
font1 = QFont()
font1.setFamily(u"Consolas")
font1.setPointSize(10)
font1.setBold(False)
font1.setWeight(50)
self.show_ori_btn.setFont(font1)
self.show_trans_btn = QPushButton(self.btnFrame)
self.show_trans_btn.setObjectName(u"show_trans_btn")
self.show_trans_btn.setGeometry(QRect(7, 5, 81, 31))
self.show_trans_btn.setFont(font1)
self.stop_trans_btn = QPushButton(self.btnFrame)
self.stop_trans_btn.setObjectName(u"stop_trans_btn")
self.stop_trans_btn.setGeometry(QRect(163, 5, 61, 31))
font2 = QFont()
font2.setPointSize(10)
self.stop_trans_btn.setFont(font2)
self.isPrintBoth = QCheckBox(self.btnFrame)
self.isPrintBoth.setObjectName(u"isPrintBoth")
self.isPrintBoth.setGeometry(QRect(10, 37, 151, 19))
self.isPrintBoth.setFont(font2)
self.isAutoTrans = QCheckBox(self.btnFrame)
self.isAutoTrans.setObjectName(u"isAutoTrans")
self.isAutoTrans.setGeometry(QRect(10, 54, 211, 19))
self.isAutoTrans.setFont(font2)
self.isPrintLog = QCheckBox(self.btnFrame)
self.isPrintLog.setObjectName(u"isPrintLog")
self.isPrintLog.setGeometry(QRect(10, 71, 211, 19))
self.isPrintLog.setFont(font2)
self.authorFrame = QFrame(self.wholeFrame)
self.authorFrame.setObjectName(u"authorFrame")
self.authorFrame.setGeometry(QRect(250, 10, 171, 91))
self.authorFrame.setFrameShape(QFrame.Box)
self.authorFrame.setFrameShadow(QFrame.Raised)
self.dev_info = QLabel(self.authorFrame)
self.dev_info.setObjectName(u"dev_info")
self.dev_info.setGeometry(QRect(95, 10, 61, 71))
self.dev_info.setFrameShape(QFrame.NoFrame)
self.go_dev_page = QPushButton(self.authorFrame)
self.go_dev_page.setObjectName(u"go_dev_page")
self.go_dev_page.setGeometry(QRect(7, 5, 75, 81))
self.log_browser = QTextBrowser(self.centralwidget)
self.log_browser.setObjectName(u"log_browser")
self.log_browser.setGeometry(QRect(10, 180, 611, 201))
MainWindow.setCentralWidget(self.centralwidget)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
self.statusbar = QStatusBar(MainWindow)
self.statusbar.setObjectName(u"statusbar")
MainWindow.setStatusBar(self.statusbar)

self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)

QMetaObject.connectSlotsByName(MainWindow)
# setupUi

def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "Ehnd 웹 번역"))
self.reloadBtn.setText(_translate("MainWindow", "리로드"))
self.trans_time.setText(_translate("MainWindow", "번역 시간:"))
self.status_lbl.setText(_translate("MainWindow", "상태: "))
self.show_ori_btn.setText(_translate("MainWindow", "원본 보기"))
self.show_trans_btn.setText(_translate("MainWindow", "번역본 보기"))
self.stop_trans_btn.setText(_translate("MainWindow", "번역 중지"))
self.isPrintBoth.setText(_translate("MainWindow", "원문/번역문 동시 출력"))
self.isAutoTrans.setText(_translate("MainWindow", "페이지 바뀔 때마다 자동 번역"))
self.isPrintLog.setText(_translate("MainWindow", "번역 로그 출력"))
self.dev_info.setText(_translate("MainWindow", "제작자: kdr \n"
" V.210422"))
self.go_dev_page.setText(_translate("MainWindow", "제작자\n"
"홈페이지"))
MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"Ehnd \uc6f9 \ubc88\uc5ed", None))
self.reloadBtn.setText(QCoreApplication.translate("MainWindow", u"\ub9ac\ub85c\ub4dc", None))
self.sec.setText("")
self.trans_time.setText(QCoreApplication.translate("MainWindow", u"\ubc88\uc5ed \uc2dc\uac04:", None))
self.show_status.setText("")
self.status_lbl.setText(QCoreApplication.translate("MainWindow", u"\uc0c1\ud0dc: ", None))
self.show_ori_btn.setText(QCoreApplication.translate("MainWindow", u"\uc6d0\ubcf8 \ubcf4\uae30", None))
self.show_trans_btn.setText(QCoreApplication.translate("MainWindow", u"\ubc88\uc5ed\ubcf8 \ubcf4\uae30", None))
self.stop_trans_btn.setText(QCoreApplication.translate("MainWindow", u"\ubc88\uc5ed \uc911\uc9c0", None))
self.isPrintBoth.setText(QCoreApplication.translate("MainWindow", u"\uc6d0\ubb38/\ubc88\uc5ed\ubb38 \ub3d9\uc2dc \ucd9c\ub825", None))
self.isAutoTrans.setText(QCoreApplication.translate("MainWindow", u"\ud398\uc774\uc9c0 \ubc14\ub014 \ub54c\ub9c8\ub2e4 \uc790\ub3d9 \ubc88\uc5ed", None))
self.isPrintLog.setText(QCoreApplication.translate("MainWindow", u"\ubc88\uc5ed \ub85c\uadf8 \ucd9c\ub825", None))
self.dev_info.setText(QCoreApplication.translate("MainWindow", u"\uc81c\uc791\uc790: kdr \n"
" V.210425", None))
self.go_dev_page.setText(QCoreApplication.translate("MainWindow", u"\uc81c\uc791\uc790\n"
"\ud648\ud398\uc774\uc9c0", None))
# retranslateUi

4 changes: 2 additions & 2 deletions UI_MAIN.ui
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>631</width>
<width>632</width>
<height>416</height>
</rect>
</property>
Expand Down Expand Up @@ -315,7 +315,7 @@
</property>
<property name="text">
<string>제작자: kdr
V.210422</string>
V.210425</string>
</property>
</widget>
<widget class="QPushButton" name="go_dev_page">
Expand Down
Binary file modified __pycache__/UI_MAIN.cpython-37.pyc
Binary file not shown.
Binary file modified __pycache__/ehnd_web_translate.cpython-37.pyc
Binary file not shown.
Binary file added __pycache__/ui.cpython-37.pyc
Binary file not shown.
21 changes: 11 additions & 10 deletions ehnd_web_translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
from module._translate_j2k import t_j2k
from module._requirement_func import *

from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *

import chromedriver_autoinstaller

Expand All @@ -28,6 +28,8 @@
findJpn = re.compile('[\u3000-\u303f\u3040-\u309f\u30a0-\u30ff\uff00-\uff9f\u4e00-\u9faf\u3400-\u4dbf]')




def async_loop(func, *args):
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
Expand Down Expand Up @@ -198,6 +200,7 @@ async def runTrans(self, i):

except exceptions.StaleElementReferenceException:
pass
# self.window.printLog("StaleElementReferenceException")



Expand All @@ -221,8 +224,6 @@ def __init__(self):

self.lastUrl = ""

self.lastTextNode = None

options = Options()
options.add_argument('--force-dark-mode')
options.add_argument(f"--user-data-dir={Path.home()}\\AppData\\Local\\Google\\Chrome\\User Data\\Default")
Expand All @@ -240,11 +241,11 @@ def __init__(self):
self.setupUi(self)
self.setWindowIcon(QIcon("./utils/sayo.ico"))

self.show_trans_btn.clicked.connect(self.showTrans)
self.show_ori_btn.clicked.connect(self.showOri)
self.go_dev_page.clicked.connect(self.goDevPage)
self.reloadBtn.clicked.connect(self.reloadWindow)
self.stop_trans_btn.clicked.connect(self.stopTrans)
QObject.connect(self.show_trans_btn, SIGNAL('clicked()'), self.showTrans)
QObject.connect(self.show_ori_btn, SIGNAL('clicked()'), self.showOri)
QObject.connect(self.go_dev_page, SIGNAL('clicked()'), self.goDevPage)
QObject.connect(self.reloadBtn, SIGNAL('clicked()'), self.reloadWindow)
QObject.connect(self.stop_trans_btn, SIGNAL('clicked()'), self.stopTrans)
self.window_list.currentIndexChanged.connect(self.setWindow)
self.isAutoTrans.stateChanged.connect(self.autoTrans)

Expand Down
2 changes: 1 addition & 1 deletion uitopy.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pyuic5.exe .\UI_MAIN.ui -o .\UI_MAIN.py
pyside2-uic .\UI_MAIN.ui -o .\UI_MAIN.py
Loading

0 comments on commit d112eb9

Please sign in to comment.