コード例 #1
0
    def melGenereater(self):
        x = ""
        x = xtools.getString(self.windowx.textEdit)

        IN1 = xtools.getString(self.windowx.lineEdit_1)
        IN2 = xtools.getString(self.windowx.lineEdit_2)
        IN3 = xtools.getString(self.windowx.lineEdit_3)
        IN4 = xtools.getString(self.windowx.lineEdit_4)
        IN5 = xtools.getString(self.windowx.lineEdit_5)
        IN5 = xtools.getString(self.windowx.lineEdit_5)

        if IN1 != None: x = x.replace("[INPUT1]", IN1)
        if IN2 != None: x = x.replace("[INPUT2]", IN2)
        if IN3 != None: x = x.replace("[INPUT3]", IN3)
        if IN4 != None: x = x.replace("[INPUT4]", IN4)
        if IN5 != None: x = x.replace("[INPUT5]", IN5)

        x = x.replace("\\", "/")

        fileName = QtGui.QFileDialog.getSaveFileName(
            self, "Save Customized Script to...", "CustomizedMEL",
            "Maya MEL (*.mel);;All Files (*)")

        if fileName != "" and x != "":

            fileObj = open(fileName, "w")
            fileObj.write(x)
            fileObj.close()

            xtools.messagebox(
                self, "Done!",
                "Customized Script Generated and Saved. Please... Reload the script, if needed!"
            )

        self.do_listscripts()
コード例 #2
0
    def melGenereater(self):
        x = ""
        x = xtools.getString(self.windowx.textEdit)

        IN1 = xtools.getString(self.windowx.lineEdit_1)
        IN2 = xtools.getString(self.windowx.lineEdit_2)
        IN3 = xtools.getString(self.windowx.lineEdit_3)
        IN4 = xtools.getString(self.windowx.lineEdit_4)
        IN5 = xtools.getString(self.windowx.lineEdit_5)
        IN5 = xtools.getString(self.windowx.lineEdit_5)

        if IN1!=None:        x = x.replace("[INPUT1]",IN1)
        if IN2!=None:        x = x.replace("[INPUT2]",IN2)
        if IN3!=None:        x = x.replace("[INPUT3]",IN3)
        if IN4!=None:        x = x.replace("[INPUT4]",IN4)
        if IN5!=None:        x = x.replace("[INPUT5]",IN5)

        x = x.replace("\\","/")

        fileName = QtGui.QFileDialog.getSaveFileName(self,"Save Customized Script to...","CustomizedMEL","Maya MEL (*.mel);;All Files (*)")


        if fileName!="" and x!="":

                fileObj = open(fileName,"w")
                fileObj.write(x)
                fileObj.close()

                xtools.messagebox(self,"Done!","Customized Script Generated and Saved. Please... Reload the script, if needed!")

        self.do_listscripts()
コード例 #3
0
    def do_findinscript(self):

        st = QtGui.QInputDialog.getText(self,"Find in Script","Search for...",QLineEdit.Normal,str(self.lastsearch))

        self.lastsearch = st[0]
        if self.ui_disp_script.find(str(st[0]))==0:
            xtools.messagebox(self,"Sorry!","Nothing found!")
コード例 #4
0
    def do_findinscript(self):

        st = QtGui.QInputDialog.getText(self, "Find in Script",
                                        "Search for...", QLineEdit.Normal,
                                        str(self.lastsearch))

        self.lastsearch = st[0]
        if self.ui_disp_script.find(str(st[0])) == 0:
            xtools.messagebox(self, "Sorry!", "Nothing found!")
コード例 #5
0
    def __init__(self,
                 Database,
                 IP="127.0.0.1",
                 UserID="root",
                 Password="******",
                 PortID=3306):

        try:
            self.connection = MySQLdb.connect(host=IP,
                                              port=PortID,
                                              user=UserID,
                                              passwd=Password,
                                              db=Database)
            self.cursor = self.connection.cursor()

        except MySQLdb.Error, e:
            xtools.messagebox(None, "Problem COnnecting to Database...",
                              "Error %d: %s" % (e.args[0], e.args[1]))
コード例 #6
0
    def do_pluginstart(self,qm):

##        from PyQt4 import uic
##
##          THIS ONE IS ERROR ON EXE PREPERATION
##
##        pluginpath =  QDir.toNativeSeparators ( QDir.currentPath() + QDir.separator () + str("Plugins"))
##        plugname = qm.text()
##        ldscript =  pluginpath + "\\" + plugname
##
##        self.windowx = loadUi(ldscript)
##
##        self.connect(self.windowx.pushButton, QtCore.SIGNAL("clicked()"), self.melGenereater)
##        self.connect(self.windowx.pushButton_2, QtCore.SIGNAL("clicked()"), self.previews)
##
##
##        self.windowx.show()

#        TODO THIS SECTION IS TO LOAD UIs Dynamically
          xtools.messagebox(self,"Under Construction","This Section is still under development!")
コード例 #7
0
    def do_pluginstart(self, qm):

        ##        from PyQt4 import uic
        ##
        ##          THIS ONE IS ERROR ON EXE PREPERATION
        ##
        ##        pluginpath =  QDir.toNativeSeparators ( QDir.currentPath() + QDir.separator () + str("Plugins"))
        ##        plugname = qm.text()
        ##        ldscript =  pluginpath + "\\" + plugname
        ##
        ##        self.windowx = loadUi(ldscript)
        ##
        ##        self.connect(self.windowx.pushButton, QtCore.SIGNAL("clicked()"), self.melGenereater)
        ##        self.connect(self.windowx.pushButton_2, QtCore.SIGNAL("clicked()"), self.previews)
        ##
        ##
        ##        self.windowx.show()

        #        TODO THIS SECTION IS TO LOAD UIs Dynamically
        xtools.messagebox(self, "Under Construction",
                          "This Section is still under development!")
コード例 #8
0
    def doSelQuery(self, qry):
        outp = []

        try:
            self.cursor.execute(qry)
            for s in self.cursor:
                outp.append(s)

        except MySQLdb.Error, e:
            print "\n" + qry
            print "Error %d: %s" % (e.args[0], e.args[1])
        except AttributeError, x:
            print x
            xtools.messagebox(
                None, "Network Problem",
                "Please! Check your Network Connection.  This machine is unable to reach the Database. \nAsk your admin to check the connection with database machine.\nNow Launching the software interface without database!"
            )

        return outp

    def __filGrid(self, xtable, headings, array):

        xtable.clearContents()
        xtable.setRowCount(array.__len__())

        xtable.setColumnCount(headings.__len__())
        for headno in xrange(0, headings.__len__()):
            item = QTableWidgetItem()
            xtable.setHorizontalHeaderItem(headno, item)
            xtable.horizontalHeaderItem(headno).setText(headings[headno])