프로젝트

일반

사용자정보

개정판 7d25e6f3

ID7d25e6f33b910a52302874bb88bd18ecb811f683
상위 c52c1783
하위 3be0a827

함의성이(가) 5년 이상 전에 추가함

issue #000: vendorpackage name can be typed manually

Change-Id: Id3b4a4a15461407f8b7edcf323f39c2269e3fe5b

차이점 보기:

DTI_PID/DTI_PID/AppDocData.py
3107 3107
    @property
3108 3108
    def OCRData(self):
3109 3109
        if self._OCRData is None:
3110
            configs = self.etConfigs('Text Recognition', 'OCR Data')
3110
            configs = self.getConfigs('Text Recognition', 'OCR Data')
3111 3111
            self._OCRData = configs[0].value if 1 == len(configs) else 'eng'
3112 3112

  
3113 3113
        return self._OCRData
DTI_PID/DTI_PID/Shapes/EngineeringVendorItem.py
60 60
    def NameText(self):
61 61
        from EngineeringTextItem import QEngineeringTextItem
62 62

  
63
        matches = [assoc for assoc in self.associations() if type(assoc) is QEngineeringTextItem]
64
        if matches:
65
            return matches[0].text()
63
        if self.associations():
64
            matches = [assoc for assoc in self.associations() if type(assoc) is QEngineeringTextItem]
65
            if matches:
66
                return matches[0].text()
67
        else:
68
            matches = [prop for prop,_ in self._properties.items() if prop.Attribute == 'Name']
69
            if matches: return self._properties[matches[0]]
66 70

  
67 71
        return None
68 72

  
......
192 196

  
193 197
        return vendorItem
194 198

  
199
    '''
195 200
    def associations(self):
196 201
        """ return associated instance """
197 202
        import uuid
......
208 213
                    res.append(assoc)
209 214

  
210 215
        return res
216
    '''
211 217

  
212 218
    def toXml(self):
213 219
        from xml.etree.ElementTree import Element, SubElement, dump, ElementTree
......
321 327

  
322 328
    def set_property(self, property, value):
323 329
        """ set property with given value """
324
        if issubclass(type(value), QEngineeringAbstractItem): self.add_assoc_item(value, 0)
330
        if issubclass(type(value), QEngineeringAbstractItem):
331
            self.add_assoc_item(value, 0)
332
        else:
333
            self._associations.clear()
325 334
        matches = [prop for prop,_ in self._properties.items() if prop.Attribute == property]
326 335
        if matches: self._properties[matches[0]] = value
327 336

  

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)