From 28e4fbcfcc5b41ad01b5718ed87d65f4353917f4 Mon Sep 17 00:00:00 2001 From: liyp Date: Fri, 25 Mar 2022 20:24:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8C=85=E7=BB=93=E6=9E=84?= =?UTF-8?q?=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MANIFEST.in | 5 +++++ main/__init__.py | 0 start.py => main/__main__.py | 5 +++-- setup.py | 35 +++++++++++++++++++++++++++++++++++ tool/QSSLoader.py | 1 + tool/__init__.py | 0 6 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 MANIFEST.in create mode 100644 main/__init__.py rename start.py => main/__main__.py (93%) create mode 100644 setup.py create mode 100644 tool/__init__.py diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..5cc802f --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,5 @@ +include MANIFEST.in +include README.md +include images/* +include resource/* +exclude test/* \ No newline at end of file diff --git a/main/__init__.py b/main/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/start.py b/main/__main__.py similarity index 93% rename from start.py rename to main/__main__.py index 77452d4..cebbf53 100644 --- a/start.py +++ b/main/__main__.py @@ -11,6 +11,7 @@ from tool import QSSLoader class MainWindow(QWidget): def __init__(self): super(MainWindow, self).__init__() + self.setWindowTitle("OSS图床上传") layout = QHBoxLayout(self, spacing=0) self.listWidget = QListWidget() self.resize(800, 600) @@ -62,10 +63,10 @@ class MainWindow(QWidget): if __name__ == '__main__': app = QApplication(sys.argv) main = MainWindow() - style_file = 'resource/current.qss' + style_file = os.getcwd()+'/resource/current.qss' style_sheet = QSSLoader.QSSLoader.read_qss_file(style_file) # apply_stylesheet(app, theme='light_blue.xml') - app.setWindowIcon(QIcon('./images/icon.svg')) + app.setWindowIcon(QIcon(os.getcwd()+'/images/icon.svg')) main.setStyleSheet(style_sheet) main.show() diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..f028a64 --- /dev/null +++ b/setup.py @@ -0,0 +1,35 @@ +""" +This is a setup.py script +""" +from setuptools import setup, find_packages + +VERSION = "0.1" +INSTALL = ["oss2", "notify2", "dbus-python", "PyQt5", "json"] +PACKAGES = find_packages() + +setup( + name="PyQtPicUpload", + version=VERSION, + author="liyp", + author_email="my@liyp.cc", + description="a OSS Image Upload Tool", + license="GPL3", + include_package_data=True, + url="https://git.liyp.cc/xmengnet/PyQtPicUpload", + classifiers=[ + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Operating System :: POSIX', + ], + + platforms=["POSIX"], + keywords=["IMAGE","OSS"], + exclude_package_date={'test':['']}, + install_requires=INSTALL, + packages=PACKAGES, + python_requires=">=3.6", +) \ No newline at end of file diff --git a/tool/QSSLoader.py b/tool/QSSLoader.py index 74ce321..6faa814 100644 --- a/tool/QSSLoader.py +++ b/tool/QSSLoader.py @@ -4,5 +4,6 @@ class QSSLoader: @staticmethod def read_qss_file(qss_file_name): + # print(qss_file_name) with open(qss_file_name, 'r', encoding='UTF-8') as file: return file.read() diff --git a/tool/__init__.py b/tool/__init__.py new file mode 100644 index 0000000..e69de29