From 0906214c276402584eb2e1910173d271350f8399 Mon Sep 17 00:00:00 2001
From: rahulp13
Date: Thu, 6 Aug 2020 00:34:48 +0530
Subject: ported GUI to PyQt5
---
src/createKicadLibrary.py | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
(limited to 'src/createKicadLibrary.py')
diff --git a/src/createKicadLibrary.py b/src/createKicadLibrary.py
index d7a39d1..65d9a9f 100644
--- a/src/createKicadLibrary.py
+++ b/src/createKicadLibrary.py
@@ -2,13 +2,13 @@ from Appconfig import Appconfig
import re
import os
import xml.etree.cElementTree as ET
-from PyQt4 import QtGui
+from PyQt5 import QtWidgets
-class AutoSchematic(QtGui.QWidget):
+class AutoSchematic(QtWidgets.QWidget):
def __init__(self, modelname):
- QtGui.QWidget.__init__(self)
+ QtWidgets.QWidget.__init__(self)
self.modelname = modelname.split('.')[0]
self.template = Appconfig.kicad_lib_template.copy()
self.xml_loc = Appconfig.xml_loc
@@ -34,14 +34,14 @@ class AutoSchematic(QtGui.QWidget):
self.createLib()
elif (xmlFound == os.path.join(self.xml_loc, 'Nghdl')):
print('Library already exists...')
- ret = QtGui.QMessageBox.warning(
+ ret = QtWidgets.QMessageBox.warning(
self, "Warning", '''Library files for this model ''' +
'''already exist. Do you want to overwrite it?
If yes press ok, else cancel it and ''' +
'''change the name of your vhdl file.''',
- QtGui.QMessageBox.Ok, QtGui.QMessageBox.Cancel
+ QtWidgets.QMessageBox.Ok, QtWidgets.QMessageBox.Cancel
)
- if ret == QtGui.QMessageBox.Ok:
+ if ret == QtWidgets.QMessageBox.Ok:
print("Overwriting existing libraries")
self.getPortInformation()
self.createXML()
@@ -52,11 +52,11 @@ class AutoSchematic(QtGui.QWidget):
quit()
else:
print('Pre existing library...')
- ret = QtGui.QMessageBox.critical(
+ ret = QtWidgets.QMessageBox.critical(
self, "Error", '''A standard library already exists ''' +
'''with this name.
Please change the name ''' +
'''of your vhdl file and upload it again''',
- QtGui.QMessageBox.Ok
+ QtWidgets.QMessageBox.Ok
)
# quit()
@@ -230,11 +230,11 @@ class AutoSchematic(QtGui.QWidget):
os.chdir(cwd)
print('Leaving directory, ', self.lib_loc)
- QtGui.QMessageBox.information(
+ QtWidgets.QMessageBox.information(
self, "Library added",
'''Library details for this model is added to the ''' +
'''eSim_Nghdl.lib in the KiCad shared directory''',
- QtGui.QMessageBox.Ok
+ QtWidgets.QMessageBox.Ok
)
--
cgit