@@ -190,11 +190,11 @@ def ValidGUIDForm(GUID):
190190
191191 print ("Testing if GUID=" ,GUID )
192192
193- m = re .search (" 0x([a-fA-F\d]{32})$" , GUID ) #0xC79926B7B668C0874433B9E5EBD0A0A2
193+ m = re .search (r' 0x([a-fA-F\d]{32})$' , GUID ) #0xC79926B7B668C0874433B9E5EBD0A0A2
194194 if m is not None :
195195 return True
196196
197- m = re .search (" ([a-fA-F\d]{8})-([a-fA-F\d]{4})-([a-fA-F\d]{4})-([a-fA-F\d]{2})([a-fA-F\d]{2})-([a-fA-F\d]{2})([a-fA-F\d]{2})([a-fA-F\d]{2})([a-fA-F\d]{2})([a-fA-F\d]{2})([a-fA-F\d]{2})" , GUID )
197+ m = re .search (r' ([a-fA-F\d]{8})-([a-fA-F\d]{4})-([a-fA-F\d]{4})-([a-fA-F\d]{2})([a-fA-F\d]{2})-([a-fA-F\d]{2})([a-fA-F\d]{2})([a-fA-F\d]{2})([a-fA-F\d]{2})([a-fA-F\d]{2})([a-fA-F\d]{2})' , GUID )
198198 if m is not None :
199199 return True
200200
@@ -212,7 +212,7 @@ def ValidateTYPE(Type):
212212 if type (Type ) is not str :
213213 Type = str (Type )
214214
215- m = re .search (" ^(0x)?([a-fA-F\d][a-fA-F\d]?)$" , Type )
215+ m = re .search (r' ^(0x)?([a-fA-F\d][a-fA-F\d]?)$' , Type )
216216 if m is None :
217217 print ("\t WARNING: Type \" %s\" is not in the form 0x4C" % Type )
218218 sys .exit (1 )
@@ -229,7 +229,7 @@ def ValidateGUID(GUID):
229229
230230 print ("Looking to validate GUID=" ,GUID )
231231
232- m = re .search (" 0x([a-fA-F\d]{32})$" , GUID ) #0xC79926B7B668C0874433B9E5EBD0A0A2
232+ m = re .search (r' 0x([a-fA-F\d]{32})$' , GUID ) #0xC79926B7B668C0874433B9E5EBD0A0A2
233233 if m is not None :
234234 tempGUID = int (m .group (1 ),16 )
235235 print ("\t GUID \" %s\" " % GUID )
@@ -247,7 +247,7 @@ def ValidateGUID(GUID):
247247
248248 else :
249249 #ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 --> #0x C7 99 26 B7 B6 68 C087 4433 B9E5 EBD0A0A2
250- m = re .search (" ([a-fA-F\d]{8})-([a-fA-F\d]{4})-([a-fA-F\d]{4})-([a-fA-F\d]{2})([a-fA-F\d]{2})-([a-fA-F\d]{2})([a-fA-F\d]{2})([a-fA-F\d]{2})([a-fA-F\d]{2})([a-fA-F\d]{2})([a-fA-F\d]{2})" , GUID )
250+ m = re .search (r' ([a-fA-F\d]{8})-([a-fA-F\d]{4})-([a-fA-F\d]{4})-([a-fA-F\d]{2})([a-fA-F\d]{2})-([a-fA-F\d]{2})([a-fA-F\d]{2})([a-fA-F\d]{2})([a-fA-F\d]{2})([a-fA-F\d]{2})([a-fA-F\d]{2})' , GUID )
251251 if m is not None :
252252 print ("Found more advanced type" )
253253 tempGUID = (int (m .group (4 ),16 )<< 64 ) | (int (m .group (3 ),16 )<< 48 ) | (int (m .group (2 ),16 )<< 32 ) | int (m .group (1 ),16 )
@@ -1080,7 +1080,7 @@ def ParseXML(XMLFile):
10801080
10811081 if 'SECTOR_SIZE_IN_BYTES' in HashInstructions :
10821082 if type (HashInstructions ['SECTOR_SIZE_IN_BYTES' ]) is str :
1083- m = re .search (" ^(\d+)$" , HashInstructions ['SECTOR_SIZE_IN_BYTES' ])
1083+ m = re .search (r' ^(\d+)$' , HashInstructions ['SECTOR_SIZE_IN_BYTES' ])
10841084 if m is None :
10851085 ## we didn't match, so assign deafult
10861086 HashInstructions ['SECTOR_SIZE_IN_BYTES' ] = 512
@@ -1101,7 +1101,7 @@ def ParseXML(XMLFile):
11011101
11021102 if 'WRITE_PROTECT_BOUNDARY_IN_KB' in HashInstructions :
11031103 if type (HashInstructions ['WRITE_PROTECT_BOUNDARY_IN_KB' ]) is str :
1104- m = re .search (" ^(\d+)$" , HashInstructions ['WRITE_PROTECT_BOUNDARY_IN_KB' ])
1104+ m = re .search (r' ^(\d+)$' , HashInstructions ['WRITE_PROTECT_BOUNDARY_IN_KB' ])
11051105 if m is None :
11061106 ## we didn't match, so assign deafult
11071107 HashInstructions ['WRITE_PROTECT_BOUNDARY_IN_KB' ] = 0
@@ -1113,7 +1113,7 @@ def ParseXML(XMLFile):
11131113
11141114 if 'PERFORMANCE_BOUNDARY_IN_KB' in HashInstructions :
11151115 if type (HashInstructions ['PERFORMANCE_BOUNDARY_IN_KB' ]) is str :
1116- m = re .search (" ^(\d+)$" , HashInstructions ['PERFORMANCE_BOUNDARY_IN_KB' ])
1116+ m = re .search (r' ^(\d+)$' , HashInstructions ['PERFORMANCE_BOUNDARY_IN_KB' ])
11171117 if m is None :
11181118 ## we didn't match, so assign deafult
11191119 HashInstructions ['PERFORMANCE_BOUNDARY_IN_KB' ] = 0
@@ -1178,7 +1178,7 @@ def ParseXML(XMLFile):
11781178
11791179 if 'DISK_SIGNATURE' in HashInstructions :
11801180 if type (HashInstructions ['DISK_SIGNATURE' ]) is str :
1181- m = re .search (" ^0x([\da-fA-F]+)$" , HashInstructions ['DISK_SIGNATURE' ])
1181+ m = re .search (r' ^0x([\da-fA-F]+)$' , HashInstructions ['DISK_SIGNATURE' ])
11821182 if m is None :
11831183 print ("WARNING: DISK_SIGNATURE is not formed correctly, expected format is 0x12345678\n " )
11841184 HashInstructions ['DISK_SIGNATURE' ] = 0x00000000
@@ -1190,7 +1190,7 @@ def ParseXML(XMLFile):
11901190
11911191 if 'ALIGN_BOUNDARY_IN_KB' in HashInstructions :
11921192 if type (HashInstructions ['ALIGN_BOUNDARY_IN_KB' ]) is str :
1193- m = re .search (" ^(\d+)$" , HashInstructions ['ALIGN_BOUNDARY_IN_KB' ])
1193+ m = re .search (r' ^(\d+)$' , HashInstructions ['ALIGN_BOUNDARY_IN_KB' ])
11941194 if m is None :
11951195 ## we didn't match, so assign deafult
11961196 HashInstructions ['ALIGN_BOUNDARY_IN_KB' ] = HashInstructions ['WRITE_PROTECT_BOUNDARY_IN_KB' ]
@@ -1541,7 +1541,7 @@ def ParseCommandLine():
15411541 print ("\n Will AUTO-DETECT from file" )
15421542
15431543 if len (sys .argv ) >= 4 : # Should mean PHY partition was specified
1544- m = re .search (" ^\d+$" , sys .argv [3 ] )
1544+ m = re .search (r' ^\d+$' , sys .argv [3 ] )
15451545 if m is not None :
15461546 PhysicalPartitionNumber = int (sys .argv [3 ])
15471547 print ("PhysicalPartitionNumber specified as %d" % PhysicalPartitionNumber )
@@ -2387,7 +2387,7 @@ def find_file(filename, search_paths):
23872387
23882388 elif o in ("-k" , "--use128partitions" ):
23892389 ## Force there to be 128 partitions in the partition table
2390- m = re .search ("\d" , a ) #mbr|gpt
2390+ m = re .search (r'\d' , a ) #mbr|gpt
23912391 if m is None :
23922392 force128partitions = 0
23932393 else :
@@ -2401,7 +2401,7 @@ def find_file(filename, search_paths):
24012401
24022402 elif o in ("-g" , "--sequentialguid" ):
24032403 ## also allow seperating commas
2404- m = re .search ("\d" , a ) #mbr|gpt
2404+ m = re .search (r'\d' , a ) #mbr|gpt
24052405 if m is None :
24062406 sequentialguid = 0
24072407 else :
@@ -2410,7 +2410,7 @@ def find_file(filename, search_paths):
24102410 elif o in ("-p" , "--partition" ):
24112411 UsingGetOpts = True
24122412 PhysicalPartitionNumber = a
2413- m = re .search (" ^(\d)$" , a ) #0|1|2
2413+ m = re .search (r' ^(\d)$' , a ) #0|1|2
24142414 if m is None :
24152415 PrintBigError ("ERROR: PhysicalPartitionNumber (-p) must be a number, you supplied *" ,a ,"*" )
24162416 else :
0 commit comments