Skip to content
This repository has been archived by the owner on Mar 17, 2024. It is now read-only.

Commit

Permalink
v0.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
josw123 committed Apr 3, 2021
1 parent bd6d1fd commit ec95bc4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 67 deletions.
2 changes: 1 addition & 1 deletion app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from engineio.async_drivers import threading

# Version
ver = 'v0.4.2'
ver = 'v0.4.3'

# Configuration for frozen
if getattr(sys, 'frozen', False):
Expand Down
65 changes: 1 addition & 64 deletions dart_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,62 +5,10 @@
import argparse
import webbrowser

from PyQt5.QtCore import QThread, Qt
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton
from PyQt5.QtGui import QIcon, QFont

from app import socketio, app, set_cors
from app.utils import read_config_file


class MainWidget(QWidget):

def __init__(self, width=200, height=50):
super().__init__()
if getattr(sys, 'frozen', False):
favicon = os.path.join(sys._MEIPASS, 'templates', 'favicon.ico')
else:
favicon = os.path.join('.', 'templates', 'favicon.ico')
self.favicon = favicon
self.initUI(width, height)

def initUI(self, width, height):
# Set Window
self.setFixedSize(200, 50)
self.setWindowTitle('Dart-Scraper')
self.setWindowIcon(QIcon(self.favicon))
self.setWindowFlags(Qt.WindowCloseButtonHint)

# Set Button
btn = QPushButton('Quit', self)
btn.setFixedSize(width, height)

# Set Button Font
font = QFont('Roboto')
font.setPointSize(14)
font.setBold(True)
btn.setFont(font)

# Set Button Click
btn.clicked.connect(self.close)
self.show()


class FlaskThread(QThread):
def __init__(self, socketio, app, host, port):
super().__init__()
self.socketio = socketio
self.app = app
self.host = host
self.port = port

def __del__(self):
self.wait()

def run(self):
self.socketio.run(self.app, host=self.host, port=self.port)


if __name__ == '__main__':

parser = argparse.ArgumentParser(description=' Dart-Scraper')
Expand All @@ -81,17 +29,6 @@ def run(self):
app.config['JSON_AS_ASCII'] = False
app.config['SECRET_KEY'] = 'secret_key'

# socketio.run(app, host='127.0.0.1', port=port, debug=False)
qApplication = QApplication(sys.argv)

# Start Flask
webapp = FlaskThread(socketio, app, '127.0.0.1', port)
webapp.start()
qApplication.aboutToQuit.connect(webapp.terminate)

# Open Web Browser
webbrowser.open_new(url)

# PyQt Widget
w = MainWidget()
sys.exit(qApplication.exec_())
socketio.run(app, host='127.0.0.1', port=port, debug=False)
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ chardet==3.0.4
Click==7.0
colorama==0.4.1
cursor==1.3.4
dart-fss==0.3.4
dart-fss==0.3.10
et-xmlfile==1.0.1
fake-useragent==0.1.11
Flask==1.1.1
Expand Down
2 changes: 1 addition & 1 deletion vue-develop/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dart-scraper",
"version": "0.4.2",
"version": "0.4.3",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
Expand Down

0 comments on commit ec95bc4

Please sign in to comment.