Skip to content
Commits on Source (2)
import subprocess as SP
from glob import glob
import os
import shutil
import pkg_resources as pkg
from contextlib import contextmanager
@contextmanager
def in_dir(name,remove=False):
pwd=os.getcwd()
if os.path.isdir(name):
shutil.rmtree(name)
os.makedirs(name)
os.chdir(name)
yield
os.chdir(pwd)
if remove:
shutil.rmtree(name)
SP.check_call(["pip", "install", "PyQt5"])
ui_path = os.path.dirname(os.path.abspath(__file__))
for root, folders, files in os.walk(ui_path):
for file in files:
file = os.path.join(root, file)
outfile, ext = os.path.splitext(file)
if ext == ".ui":
outfile = outfile + ".py"
print(os.path.basename(file), "->", os.path.basename(outfile))
SP.check_call(["pyuic5", "--from-imports", "-o", outfile, file])
SP.check_call(["pip", "install", ".[dev]"])
main_py=os.path.abspath("ed_lrr_gui\__main__.py")
with in_dir("exe"):
with in_dir("pyinstaller"):
SP.check_call(
[
"pyinstaller",
"--clean",
"--noupx",
"-c",
'--key="ED_LRR_GUI"',
"--name",
"ED_LRR",
main_py,
]
)
with in_dir("nuitka"):
SP.check_call(
[
"python",
"-m",
"nuitka",
"--plugin-enable=multiprocessing",
"--plugin-enable=qt-plugins",
"--standalone",
"--follow-imports",
main_py,
]
)
# with in_dir("installer"):
# shutil.rmtree("Output")
# SP.check_call(["iscc", "/QP", "ED_LRR.iss"])
......@@ -10,4 +10,5 @@ for root, folders, files in os.walk(ui_path):
outfile, ext = os.path.splitext(file)
if ext == ".ui":
outfile = outfile + ".py"
print(file,"->",outfile)
SP.check_call(["pyuic5", "--from-imports", "-o", outfile, file])
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'D:\devel\rust\ed_lrr_gui\ed_lrr_gui\gui\widget_route.ui'
#
# Created by: PyQt5 UI code generator 5.13.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.setWindowModality(QtCore.Qt.WindowModal)
Dialog.resize(430, 300)
self.layout_main = QtWidgets.QGridLayout(Dialog)
self.layout_main.setObjectName("layout_main")
self.layout_top = QtWidgets.QGridLayout()
self.layout_top.setObjectName("layout_top")
self.lst_route = QtWidgets.QTreeWidget(Dialog)
self.lst_route.setProperty("showDropIndicator", False)
self.lst_route.setDefaultDropAction(QtCore.Qt.IgnoreAction)
self.lst_route.setAlternatingRowColors(True)
self.lst_route.setSelectionMode(QtWidgets.QAbstractItemView.NoSelection)
self.lst_route.setVerticalScrollMode(QtWidgets.QAbstractItemView.ScrollPerItem)
self.lst_route.setHorizontalScrollMode(QtWidgets.QAbstractItemView.ScrollPerPixel)
self.lst_route.setItemsExpandable(False)
self.lst_route.setAllColumnsShowFocus(False)
self.lst_route.setObjectName("lst_route")
self.layout_top.addWidget(self.lst_route, 0, 0, 1, 1)
self.layout_main.addLayout(self.layout_top, 0, 0, 1, 1)
self.layout_bottom = QtWidgets.QGridLayout()
self.layout_bottom.setObjectName("layout_bottom")
self.chk_copy = QtWidgets.QCheckBox(Dialog)
self.chk_copy.setObjectName("chk_copy")
self.layout_bottom.addWidget(self.chk_copy, 1, 0, 1, 1)
self.pushButton = QtWidgets.QPushButton(Dialog)
self.pushButton.setObjectName("pushButton")
self.layout_bottom.addWidget(self.pushButton, 1, 1, 1, 1)
self.layout_main.addLayout(self.layout_bottom, 1, 0, 1, 1)
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog):
_translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Route"))
self.lst_route.headerItem().setText(0, _translate("Dialog", "Num"))
self.lst_route.headerItem().setText(1, _translate("Dialog", "System"))
self.lst_route.headerItem().setText(2, _translate("Dialog", "Body"))
self.lst_route.headerItem().setText(3, _translate("Dialog", "Distance (Ls)"))
self.chk_copy.setText(_translate("Dialog", "Auto-copy next hop to clipboard"))
self.pushButton.setText(_translate("Dialog", "Close"))
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog">
<property name="windowModality">
<enum>Qt::WindowModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>430</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Route</string>
</property>
<layout class="QGridLayout" name="layout_main">
<item row="0" column="0">
<layout class="QGridLayout" name="layout_top">
<item row="0" column="0">
<widget class="QTreeWidget" name="lst_route">
<property name="showDropIndicator" stdset="0">
<bool>false</bool>
</property>
<property name="defaultDropAction">
<enum>Qt::IgnoreAction</enum>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::NoSelection</enum>
</property>
<property name="verticalScrollMode">
<enum>QAbstractItemView::ScrollPerItem</enum>
</property>
<property name="horizontalScrollMode">
<enum>QAbstractItemView::ScrollPerPixel</enum>
</property>
<property name="itemsExpandable">
<bool>false</bool>
</property>
<property name="allColumnsShowFocus">
<bool>false</bool>
</property>
<column>
<property name="text">
<string>Num</string>
</property>
</column>
<column>
<property name="text">
<string>System</string>
</property>
</column>
<column>
<property name="text">
<string>Body</string>
</property>
</column>
<column>
<property name="text">
<string>Distance (Ls)</string>
</property>
</column>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<layout class="QGridLayout" name="layout_bottom">
<item row="1" column="0">
<widget class="QCheckBox" name="chk_copy">
<property name="text">
<string>Auto-copy next hop to clipboard</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>Close</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>