From 39fecda9f1be8b1007552437d53c06bdc02f4b47 Mon Sep 17 00:00:00 2001 From: Tanay Mathur Date: Tue, 23 Jun 2015 11:50:52 +0530 Subject: Added subcircuit functionality --- src/subcircuit/openSub.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/subcircuit/openSub.py (limited to 'src/subcircuit/openSub.py') diff --git a/src/subcircuit/openSub.py b/src/subcircuit/openSub.py new file mode 100644 index 00000000..fb349f0a --- /dev/null +++ b/src/subcircuit/openSub.py @@ -0,0 +1,24 @@ +from PyQt4 import QtGui +from configuration.Appconfig import Appconfig +from projManagement.Worker import WorkerThread +import os + + +class openSub(QtGui.QWidget): + """ + This class is called when User click on Open Project Button + """ + def __init__(self): + super(openSub, self).__init__() + self.obj_appconfig = Appconfig() + + def body(self): + self.editfile = str(QtGui.QFileDialog.getExistingDirectory(None,"Open File","../SubcircuitLibrary")) + if self.editfile: + self.obj_Appconfig = Appconfig() + self.obj_Appconfig.current_subcircuit['SubcircuitName'] = self.editfile + self.schname = os.path.basename(self.editfile) + self.editfile = os.path.join(self.editfile,self.schname) + self.cmd = "eeschema "+self.editfile+".sch " + self.obj_workThread = WorkerThread(self.cmd) + self.obj_workThread.start() \ No newline at end of file -- cgit