Exemple #1
0
    def __init__(self, **keywords):
        '''
        Initialize
        '''
        #--- Setup logging
        self.logger = LOGGER
        self.logger.debug('GetData(): __init__()')

        # xml object
        self.xmlObj = tmXml.tmXml()
Exemple #2
0
    def _status_labels(self, name=None, statusGroupBox=None, hl=None, path=None):
        """ """
        #read xml if it exists and set status
        # model_info.xml concept_info.xml texture_info.xml rig_info.xml
        #assetInfoFiles = ['model_info.xml','concept_info.xml','texture_info.xml','rig_info.xml']
        if 'animation' in path:
            pathToXml = os.path.join(path, 'meta','anim_info.xml')
        else:
            pathToXml = os.path.join(path, 'meta', name + '_info.xml')
        #setValue(typ = None, value = None, filePath = None, userName = None ):
        #SetData.SetData().setValue('status', value, pathToXml, 'msantos' )
        sd = SetData.SetData().setValue
        scMethod = self._status_color
        optList = [ ['wts',[sd,['status', 'wts', pathToXml, 'msantos',scMethod]]], 
                   ['ip',[sd,['status', 'ip', pathToXml, 'msantos',scMethod ]]], 
                   ['review',[sd,['status', 'review', pathToXml, 'msantos',scMethod ]]], 
                   ['final',[sd,['status', 'final', pathToXml, 'msantos',scMethod ]]],
                   ['hold',[sd,['status', 'hold', pathToXml, 'msantos',scMethod ]]] 
                 ]

        if os.path.exists(pathToXml):
            
            xmlObj = tmXml.tmXml()
            xmlFile = xmlObj.readXml(pathToXml)
            status = xmlObj.getTagValueByTagName(xmlFile, 'status')
            sColor = self._status_color(status)

            statusLabel = ExtendedLabel.ExtendedLabel( statusGroupBox, optList )
            statusLabel.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
            statusLabel.setAutoFillBackground(False)
            statusLabel.setStyleSheet("QLabel { background-color: rgb("+sColor+") } ")
            
            if 'animation' in path:
                statusLabel.setText(" ")
            else:
                statusLabel.setText(" %s"%name[0].title()) 
                
            #statusLabel.setPixmap(QtGui.QPixmap("../graphics/png/status_open_small.png"))
            #statusLabel.setScaledContents(True)
            statusLabel.setObjectName(name)
            hl.addWidget(statusLabel)
            
        else:
            # file could not be found

            statusLabel = ExtendedLabel.ExtendedLabel( statusGroupBox, optList )
            statusLabel.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
            statusLabel.setAutoFillBackground(False)
            statusLabel.setStyleSheet("background-color: rgb(10,10,10);")
            statusLabel.setText("")
            #statusLabel.setPixmap(QtGui.QPixmap("../graphics/png/status_open_small.png"))
            #statusLabel.setScaledContents(True)
            statusLabel.setObjectName(name)
            hl.addWidget(statusLabel)
            return False