프로젝트

일반

사용자정보

개정판 e5e77709

IDe5e77709d43efa4bec20a6da9cb2296de0743df1
상위 8bde3c30
하위 a9773437, c13279fb

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

issue #000: fic db and remove uuid version

Change-Id: I1c7c1fcb794a2f9cd4714fcc8e4eb6ad00819a11

차이점 보기:

DTI_PID/DTI_PID/AppDocData.py
1967 1967
                rows = cursor.fetchall()
1968 1968
                for row in rows:
1969 1969
                    attr = SymbolAttr()
1970
                    attr.UID = uuid.UUID(row[0], version=4)
1970
                    attr.UID = uuid.UUID(row[0])
1971 1971
                    attr.Attribute = row[1]
1972 1972
                    attr.DisplayAttribute = row[2]
1973 1973
                    attr.AttributeType = row[3]
DTI_PID/DTI_PID/Drawing.py
173 173

  
174 174
            for component in [component for component in components if component['Name'] == 'Trim Line NO' and component['SymbolType_UID'] == -1]:
175 175
                tracer_line_no = QEngineeringTrimLineNoTextItem()
176
                tracer_line_no.uid = uuid.UUID(component['UID'], version=4)
176
                tracer_line_no.uid = uuid.UUID(component['UID'])
177 177

  
178 178
                runs = app_doc_data.get_pipe_runs(str(tracer_line_no.uid))
179 179
                if not runs: continue
DTI_PID/DTI_PID/MainWindow.py
2499 2499

  
2500 2500
            for component in [component for component in components if component['Name'] == 'Trim Line NO' and component['SymbolType_UID'] == -1]:
2501 2501
                line_no = QEngineeringTrimLineNoTextItem()
2502
                line_no.uid = uuid.UUID(component['UID'], version=4)
2502
                line_no.uid = uuid.UUID(component['UID'])
2503 2503

  
2504 2504
                runs = app_doc_data.get_pipe_runs(str(line_no.uid))
2505 2505
                if not runs: continue
......
2727 2727

  
2728 2728
            for trimLineNo in root.iter('TRIM_LINE_NO'):
2729 2729
                line_no = QEngineeringTrimLineNoTextItem()
2730
                line_no.uid = uuid.UUID(trimLineNo.find('UID').text, version=4)
2730
                line_no.uid = uuid.UUID(trimLineNo.find('UID').text)
2731 2731

  
2732 2732
                run = trimLineNo.find('RUN')
2733 2733
                if run is not None:
DTI_PID/DTI_PID/Scripts/MSSQL/ID2.sql
3465 3465
    Owner                VARCHAR (37),
3466 3466
	[From] 				[varchar](37) NULL,
3467 3467
	[To] 				[varchar](37) NULL,
3468
    Connected            TEXT,
3468
    Connected            VARCHAR (37),
3469 3469
    [Supplied By]        TEXT,
3470 3470
    SpecialItemTypes_UID VARCHAR (37) REFERENCES SpecialItemTypes (UID),
3471 3471
	[Freeze] [int] NULL,
......
4096 4096

  
4097 4097
CREATE TABLE NOTE_DATA_LIST (
4098 4098
    UID         VARCHAR (37),
4099
    NOTE_NO     TEXT,
4099
    NOTE_NO     VARCHAR (32),
4100 4100
    DESCRIPTION TEXT,
4101 4101
    PNID_NO     VARCHAR(256) NOT NULL,
4102 4102
    CONSTRAINT NOTE_DATA_LIST_PK PRIMARY KEY (
DTI_PID/DTI_PID/Shapes/EngineeringConnectorItem.py
41 41

  
42 42
        QGraphicsEllipseItem.__init__(self, parent)
43 43

  
44
        self.uid = uuid.uuid4() if uid is None else uuid.UUID(uid, version=4)
44
        self.uid = uuid.uuid4() if uid is None else uuid.UUID(uid)
45 45
        self.parent = parent
46 46
        self.buildItem()
47 47
        self._direction = 'AUTO'
......
450 450
            connectPointStr = [record['X'], record['Y']]
451 451
            sceneConnectPointStr = [record['X'], record['Y']]
452 452

  
453
            self._connectedItem = uuid.UUID(connectedItemStr, version=4) if connectedItemStr and connectedItemStr != 'None' else None
453
            self._connectedItem = uuid.UUID(connectedItemStr) if connectedItemStr and connectedItemStr != 'None' else None
454 454
            self.connectPoint = (float(connectPointStr[0]), float(connectPointStr[1]))
455 455
            self.sceneConnectPoint = (float(sceneConnectPointStr[0]), float(sceneConnectPointStr[1]))
456 456

  
......
467 467
        import uuid
468 468

  
469 469
        try:
470
            if 'UID' in node.attrib: self.uid = uuid.UUID(node.attrib['UID'], version=4)
470
            if 'UID' in node.attrib: self.uid = uuid.UUID(node.attrib['UID'])
471 471

  
472 472
            if 'CONNECTED_AT' in node.attrib:
473 473
                self._connected_at = QEngineeringAbstractItem.CONNECTED_AT_PT if node.attrib['CONNECTED_AT'] == '0' else QEngineeringAbstractItem.CONNECTED_AT_BODY
......
478 478
            connectPointStr = node.find('CONNECTPOINT').text.split(',')
479 479
            sceneConnectPointStr = node.find('SCENECONNECTPOINT').text.split(',')
480 480

  
481
            self._connectedItem = uuid.UUID(connectedItemStr, version=4) if connectedItemStr != 'None' else None
481
            self._connectedItem = uuid.UUID(connectedItemStr) if connectedItemStr != 'None' else None
482 482
            self.connectPoint = (float(connectPointStr[0]), float(connectPointStr[1]))
483 483
            self.sceneConnectPoint = (float(sceneConnectPointStr[0]), float(sceneConnectPointStr[1]))
484 484

  
DTI_PID/DTI_PID/Shapes/EngineeringLineItem.py
42 42
            QGraphicsLineItem.__init__(self, parent)
43 43
            QEngineeringAbstractItem.__init__(self)
44 44

  
45
            self.uid = uuid.uuid4() if uid is None else uuid.UUID(uid, version=4)
45
            self.uid = uuid.uuid4() if uid is None else uuid.UUID(uid)
46 46
            self.thickness = thickness
47 47

  
48 48
            self.setPen(QPen(Qt.blue, 4, Qt.SolidLine)) # set default pen
......
1233 1233
        try:
1234 1234
            uidNode = component['UID']
1235 1235
            uid = uidNode if uidNode is not None else uuid.uuid4() # generate UUID
1236
            owner = uuid.UUID(component['Owner'], version=4) if component['Owner'] and component['Owner'] != 'None' else None
1236
            owner = uuid.UUID(component['Owner']) if component['Owner'] and component['Owner'] != 'None' else None
1237 1237

  
1238 1238
            app_doc_data = AppDocData.instance()
1239 1239
            connectors = app_doc_data.get_component_connectors(uid)
......
1301 1301
        try:
1302 1302
            uidNode = node.find('UID')
1303 1303
            uid = uidNode.text if uidNode is not None else uuid.uuid4() # generate UUID
1304
            owner = uuid.UUID(node.attrib['OWNER'], version=4) if 'OWNER' in node.attrib and node.attrib['OWNER'] != 'None' else None
1304
            owner = uuid.UUID(node.attrib['OWNER']) if 'OWNER' in node.attrib and node.attrib['OWNER'] != 'None' else None
1305 1305

  
1306 1306
            startPoint = [float(x) for x in node.find('STARTPOINT').text.split(',')]
1307 1307
            endPoint = [float(x) for x in node.find('ENDPOINT').text.split(',')]
DTI_PID/DTI_PID/Shapes/EngineeringLineNoTextItem.py
327 327
                    attr = SymbolAttr.from_record(_attr)
328 328
                    item.attrs[attr] = _attr['Value']
329 329

  
330
                item.uid = uuid.UUID(component['UID'], version=4)
330
                item.uid = uuid.UUID(component['UID'])
331 331
                item.loc = [x, y]
332 332
                item.size = (width, height)
333 333
                item.angle = angle
......
379 379
                    attr = SymbolAttr.fromXml(attr_node)
380 380
                    item.attrs[attr] = attr_node.text
381 381

  
382
                item.uid = uuid.UUID(node.find('UID').text, version=4)
382
                item.uid = uuid.UUID(node.find('UID').text)
383 383
                item.loc = [x, y]
384 384
                item.size = (width, height)
385 385
                item.angle = angle
DTI_PID/DTI_PID/Shapes/EngineeringTextItem.py
37 37
        QGraphicsTextItem.__init__(self, parent)
38 38
        QEngineeringAbstractItem.__init__(self)
39 39

  
40
        self.uid = uuid.uuid4() if uid is None else uuid.UUID(uid, version=4)
40
        self.uid = uuid.uuid4() if uid is None else uuid.UUID(uid)
41 41
        self.type = 'TEXT'
42 42
        self.loc = None
43 43
        self.size = None
......
509 509
            item = TextItemFactory.instance().createTextItem(textInfo)
510 510
            if item is not None:
511 511
                item.setVisible(False)
512
                item.uid = uuid.UUID(component['UID'], version=4)
512
                item.uid = uuid.UUID(component['UID'])
513 513
                item.loc = [x, y]
514 514
                item.size = [width, height]
515 515
                item.angle = angle
516 516
                item.setToolTip('<b>{}</b><br>LINE NO={}'.format(str(item.uid), text))
517 517

  
518 518
                if component['Owner'] and component['Owner'] != 'None':
519
                    item._owner = uuid.UUID(component['Owner'], version=4)
519
                    item._owner = uuid.UUID(component['Owner'])
520 520

  
521 521
                ## assign area
522 522
                if not component['Area']:
......
588 588
                item.setVisible(False)
589 589

  
590 590
                if node.find('OWNER') is not None and node.find('OWNER').text != 'None':
591
                    item._owner = uuid.UUID(node.find('OWNER').text, version=4)
591
                    item._owner = uuid.UUID(node.find('OWNER').text)
592 592

  
593 593
            ## assign area
594 594
            if item is not None:
DTI_PID/DTI_PID/Shapes/EngineeringVendorItem.py
33 33
        QGraphicsPolygonItem.__init__(self, polygon, parent)
34 34
        QEngineeringAbstractItem.__init__(self)
35 35

  
36
        self.uid = str(uuid.uuid4()) if uid is None else uuid.UUID(uid, version=4)
36
        self.uid = str(uuid.uuid4()) if uid is None else uuid.UUID(uid)
37 37
        self.points = points
38 38

  
39 39
        self.isEntered = False
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py
43 43
            QGraphicsItem.ItemIsSelectable | QGraphicsItem.ItemIsFocusable | QGraphicsItem.ItemSendsGeometryChanges)
44 44

  
45 45
        self.dbUid = None  # symbol UID
46
        self.uid = uuid.uuid4() if uid is None else uuid.UUID(uid, version=4)
46
        self.uid = uuid.uuid4() if uid is None else uuid.UUID(uid)
47 47
        self.name = ''
48 48
        self.type = ''
49 49
        self.angle = 0
......
1564 1564
                                item.attrs[_attr] = [attr.text.split(',')[0], attr.text.split(',')[1]]
1565 1565
                            else:
1566 1566
                                ## for old spec break item that has not uid currectly, may not necessary new data
1567
                                _attr.AssocItem = uuid.UUID(attr.text, version=4) if attr.text else None
1567
                                _attr.AssocItem = uuid.UUID(attr.text) if attr.text else None
1568 1568
                                ## up to here 3
1569 1569
                                item.attrs[_attr] = attr.text
1570 1570
                            '''
......
1640 1640
            item = SymbolSvgItem(path, uid, flip=flip)
1641 1641

  
1642 1642
        if owner is not None:
1643
            item.owner = uuid.UUID(owner, version=4)
1643
            item.owner = uuid.UUID(owner)
1644 1644

  
1645 1645
        return item
1646 1646

  
DTI_PID/DTI_PID/SymbolAttr.py
7 7
    def __init__(self, UID, Attribute, AttributType, Freeze=False, DisplayAttribute=None, Length=None, Expression=None):
8 8
        import uuid
9 9

  
10
        self.UID = uuid.uuid4() if UID is None else uuid.UUID(UID, version=4)
10
        self.UID = uuid.uuid4() if UID is None else uuid.UUID(UID)
11 11
        self.Freeze = Freeze
12 12
        self.Attribute = Attribute
13 13
        self.AttributeType = AttributType
......
40 40
        """ parse record for property """
41 41
        import uuid
42 42
        
43
        self.UID = uuid.UUID(record['UID'], version=4)
43
        self.UID = uuid.UUID(record['UID'])
44 44
        self.Freeze = record['Freeze'] == 'True' if record['Freeze'] else False
45 45
        self.Attribute = record['Attribute']
46 46
        self.AttributeType = record['AttributeType']
......
52 52
        """ parse xml node for property """
53 53
        import uuid
54 54
        
55
        self.UID = uuid.UUID(node.attrib['UID'], version=4)
55
        self.UID = uuid.UUID(node.attrib['UID'])
56 56
        self.Freeze = node.attrib['Freeze'] == 'True' if 'Freeze' in node.attrib else False
57 57
        self.Attribute = node.attrib['Attribute']
58 58
        self.AttributeType = node.attrib['AttributeType']
......
83 83
        False
84 84
        """
85 85
        try:
86
            uuid_obj = uuid.UUID(value, version=version)
86
            uuid_obj = uuid.UUID(value)#, version=version)
87 87
        except:
88 88
            return False
89 89

  
......
96 96
        if self.AttributeType == 'Boolean':
97 97
            return True if text and text == 'True' else False
98 98
        else:
99
            return uuid.UUID(text, version=4) if text and SymbolProp.is_valid_uuid(text) else text if text else ''
99
            return uuid.UUID(text) if text and SymbolProp.is_valid_uuid(text) else text if text else ''
100 100

  
101 101
    def toXml(self):
102 102
        """ generate xml code for symbol property """
......
137 137
        import uuid
138 138
        
139 139
        attr = SymbolAttr()
140
        attr.UID = uuid.UUID(record['UID'], version=4)
140
        attr.UID = uuid.UUID(record['UID'])
141 141
        attr.Freeze = record['Freeze'] == 'True' if record['Freeze'] else False
142 142
        attr.Attribute = record['Attribute']
143 143
        attr.DisplayAttribute = record['DisplayAttribute']
......
146 146
        attr.Expression = record['Expression']
147 147
        attr.Length = record['Length'] if 'Length' in record else 0
148 148
        attr.IsProp = int(record['Property']) if record['Property'] else 0
149
        attr.AssocItem = uuid.UUID(record['Association_UID'], version=4) if record['Association_UID'] and record['Association_UID'] != 'None' else None
149
        attr.AssocItem = uuid.UUID(record['Association_UID']) if record['Association_UID'] and record['Association_UID'] != 'None' else None
150 150

  
151 151
        return attr
152 152

  
......
156 156
        import uuid
157 157

  
158 158
        attr = SymbolAttr()
159
        attr.UID = uuid.UUID(node.attrib['UID'], version=4) if 'UID' in node.attrib and node.attrib['UID'] != '' else uuid.uuid4()
159
        attr.UID = uuid.UUID(node.attrib['UID']) if 'UID' in node.attrib and node.attrib['UID'] != '' else uuid.uuid4()
160 160
        attr.Freeze = node.attrib['Freeze'] == 'True' if 'Freeze' in node.attrib else False
161 161
        attr.Attribute = node.attrib['Attribute']
162 162
        attr.DisplayAttribute = node.attrib['DisplayAttribute']
......
164 164
        attr.AttrAt = node.attrib['AttrAt']
165 165
        attr.Expression = node.attrib['Expression']
166 166
        attr.Length = node.attrib['Length']
167
        attr.AssocItem = uuid.UUID(node.attrib['AssocItem'], version=4) if 'AssocItem' in node.attrib and node.attrib['AssocItem'] != '' else None
167
        attr.AssocItem = uuid.UUID(node.attrib['AssocItem']) if 'AssocItem' in node.attrib and node.attrib['AssocItem'] != '' else None
168 168

  
169 169
        return attr
170 170

  
DTI_PID/DTI_PID/TextItemEditDialog.py
47 47
        import uuid
48 48

  
49 49
        try:
50
            uuid_obj = uuid.UUID(text, version=version)
50
            uuid_obj = uuid.UUID(text)#, version=version)
51 51
        except:
52 52
            return False
53 53

  

내보내기 Unified diff

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