프로젝트

일반

사용자정보

개정판 74e99aed

ID74e99aed9ed155b397c77f104432bbfaba28ca84
상위 1d135025
하위 cd7b7254

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

add drawing uid changer

Change-Id: Ia1ed6dbeeb91d46af78d9b89671d39f4fa4e1fc7

차이점 보기:

minorTools/xmlUIDChanger.py
1
import uuid
2
import os
3

  
4
def changer():
5
    
6
    print("uid changer start")
7
    
8
    path = 'W:\SHI\Temp'
9
    xml = 'Sample_Test_Page5.xml'
10
    xmlPath = os.path.join(path, xml)
11

  
12
    print("xmlPath : " + xmlPath)
13
    
14
    fw = open(xmlPath, 'r', encoding='utf8')
15
    xmlCon = fw.read()
16
    fw.close()
17

  
18
    uidList = []
19

  
20
    for index in range(len(xmlCon)):
21
        if len(xmlCon) - index < 36:
22
            break
23

  
24
        try:
25
            text = xmlCon[index:index + 36]
26
            uid = uuid.UUID(text)
27
            uidList.append(str(uid))
28
        except:
29
            pass
30
        finally:
31
            pass
32

  
33
    uidList = list(set(uidList))
34
    for uid in uidList:
35
        xmlCon = xmlCon.replace(uid, str(uuid.uuid4()))
36

  
37
    fw = open(xmlPath, 'w', encoding='utf8')
38
    fw.write(xmlCon)
39
    fw.close()
40

  
41
    print("uid changer end")
42

  
43
if __name__ == '__main__':
44
    selection = input("start enter 1 : ")
45
    if selection == '1':
46
        changer()

내보내기 Unified diff

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