def __init__(self, root, project): self.currentStep = self.__tables self.steps = ( self.__tables, self.__mode, self.__params, self.__result ) self.root = root self.project = project.data self.project_name = project.name Step.__init__(self) self.setWindowTitle(u'"Экспорт в AMF') self._fill() self.currentStep() self._restoreGeom('dialog/amf/geometry', 800, 300)
def __init__(self, root, project): self.currentStep = self.__discover self.steps = ( self.__discover, self.__params, self.__progress ) self.root = root self.scriptName = None self.project = project.data self.thread = Thread(self.root, self) self.connect(self.thread, QtCore.SIGNAL('progressed(float)'), self.__progressed) self.connect(self.thread, QtCore.SIGNAL('finished()'), self.__finish) self.connect(self.thread, QtCore.SIGNAL('print(QString)'), self.__newline) self._progress = 0 self.path = os.path.join(self.project.path, 'scripts') Step.__init__(self, self.root.window) self._restoreGeom('dialog/plugin/geometry', 800, 300) self.setWindowTitle(u'Выполнить скрипт') self.cbd = QtGui.QPlainTextEdit() self.cbd.setReadOnly(True) self.cb = CB(self, [ k for k in os.listdir(self.path) if re.search('.py$', k) and k != '__base__.py' ]) self.connect( self.cb, QtCore.SIGNAL('currentIndexChanged(int)'), self.__getDiscription ) self.__getDiscription() self.output = QtGui.QPlainTextEdit() self.output.setReadOnly(True) self.progressBar = QtGui.QProgressBar() self.progressBar.setMaximum(100) self.progressBar.setMinimum(0) self.currentStep()