-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmp
83 lines (72 loc) · 2.76 KB
/
tmp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
def beautifulBinaryString(binaryString):
ASCII_A = 65
listA = []
listB = []
charIdxs = [list(listA), list(listB)]
for i in range(len(binaryString)):
if (binaryString[i] != 'A' and binaryString[i] != 'B'):
return False
charIdxs[ord(binaryString[i]) - ASCII_A].append(i)
print(charIdxs)
if (len(charIdxs[0]) % 2 or len(charIdxs[1]) % 2):
return False
for charIdx in charIdxs:
matchIdx = []
for i in range(len(charIdx) - 1):
if i in matchIdx:
continue
for j in range(i + 1, len(charIdx)):
if j in matchIdx:
continue
if (j - i) % 2 == 0: #insect same
continue
else:
if (charIdx[j] - charIdx[i] % 2 != 0): #not insect diff
matchIdx.append(i)
matchIdx.append(j)
break
print(matchIdx)
return True
print(beautifulBinaryString("BABBBA"))
D_FUNC_ID_KEY = "funcid"
D_TESTSPEC_KEY = "testspecpath"
D_TESTSCRIPT_KEY = "testscriptpath"
D_CANTATA_RESULT_XML_KEY = "canataxml"
D_CANTATA_RESULT_HTML_KEY = "cantatahtml"
class ReleaseManager:
def __init__(self):
self.mSvnPath = ""
self.mInprogressPath = ""
self.mReleasePath = ""
self.mReleaseStuffs = []
self.mLogData = {}
pass
def LoadConfig(self):
pass
def LoadReleaseInfo(self):
# read assignee file to get self.mReleaseStuffs
pass
def CheckRequiredData(self):
for testSpecMng in self.mReleaseStuffs:
errorMsg = testSpecMng.CheckRequiredData()
# if has error. prepare for log file
if errorMsg:
if testSpecMng.mPIC not in self.mLogData:
self.mLogData[testSpecMng.mPIC] = {}
if testSpecMng.mId not in self.mLogData[testSpecMng.mPIC]:
self.mLogData[testSpecMng.mPIC][testSpecMng.mId] = []
self.mLogData[testSpecMng.mPIC][testSpecMng.mId] += errorMsg
def CheckCorrectFormat(self):
for testSpecMng in self.mReleaseStuffs:
errorMsg = testSpecMng.CheckCorrectFormat()
# if has error. prepare for log file
if errorMsg:
if testSpecMng.mPIC not in self.mLogData:
self.mLogData[testSpecMng.mPIC] = {}
if testSpecMng.mId not in self.mLogData[testSpecMng.mPIC]:
self.mLogData[testSpecMng.mPIC][testSpecMng.mId] = []
self.mLogData[testSpecMng.mPIC][testSpecMng.mId] += errorMsg
def CopyStuff(self):
pass
def LogFile(self):
pass