mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Use ruff
to enforce python code formatting (#37117)
Requires servo/servo#37045 for deps and config. Testing: No need for tests to test tests. Fixes: servo/servo#37041 --------- Signed-off-by: zefr0x <zer0-x.7ty50@aleeas.com>
This commit is contained in:
parent
41ecfb53a1
commit
c96de69e80
67 changed files with 3021 additions and 3085 deletions
|
@ -31,7 +31,7 @@ Example:
|
|||
""")
|
||||
sys.exit(0)
|
||||
|
||||
rust_source = open(sys.argv[1], 'r')
|
||||
rust_source = open(sys.argv[1], "r")
|
||||
lines = iter(rust_source)
|
||||
for line in lines:
|
||||
if line.lstrip().startswith("pub enum ProfilerCategory"):
|
||||
|
@ -53,21 +53,21 @@ plist = ElementTree.ElementTree(ElementTree.fromstring(xml))
|
|||
|
||||
elems = iter(plist.findall("./dict/*"))
|
||||
for elem in elems:
|
||||
if elem.tag != 'key' or elem.text != '$objects':
|
||||
if elem.tag != "key" or elem.text != "$objects":
|
||||
continue
|
||||
array = elems.next()
|
||||
break
|
||||
|
||||
elems = iter(array.findall("./*"))
|
||||
for elem in elems:
|
||||
if elem.tag != 'string' or elem.text != 'kdebugIntervalRule':
|
||||
if elem.tag != "string" or elem.text != "kdebugIntervalRule":
|
||||
continue
|
||||
dictionary = elems.next()
|
||||
break
|
||||
|
||||
elems = iter(dictionary.findall("./*"))
|
||||
for elem in elems:
|
||||
if elem.tag != 'key' or elem.text != 'NS.objects':
|
||||
if elem.tag != "key" or elem.text != "NS.objects":
|
||||
continue
|
||||
objects_array = elems.next()
|
||||
break
|
||||
|
@ -76,33 +76,33 @@ child_count = sum(1 for _ in iter(array.findall("./*")))
|
|||
|
||||
for code_pair in code_pairs:
|
||||
number_index = child_count
|
||||
integer = Element('integer')
|
||||
integer = Element("integer")
|
||||
integer.text = str(int(code_pair[0], 0))
|
||||
array.append(integer)
|
||||
child_count += 1
|
||||
|
||||
string_index = child_count
|
||||
string = Element('string')
|
||||
string = Element("string")
|
||||
string.text = code_pair[1]
|
||||
array.append(string)
|
||||
child_count += 1
|
||||
|
||||
dictionary = Element('dict')
|
||||
key = Element('key')
|
||||
dictionary = Element("dict")
|
||||
key = Element("key")
|
||||
key.text = "CF$UID"
|
||||
dictionary.append(key)
|
||||
integer = Element('integer')
|
||||
integer = Element("integer")
|
||||
integer.text = str(number_index)
|
||||
dictionary.append(integer)
|
||||
objects_array.append(dictionary)
|
||||
|
||||
dictionary = Element('dict')
|
||||
key = Element('key')
|
||||
dictionary = Element("dict")
|
||||
key = Element("key")
|
||||
key.text = "CF$UID"
|
||||
dictionary.append(key)
|
||||
integer = Element('integer')
|
||||
integer = Element("integer")
|
||||
integer.text = str(string_index)
|
||||
dictionary.append(integer)
|
||||
objects_array.append(dictionary)
|
||||
|
||||
plist.write(sys.stdout, encoding='utf-8', xml_declaration=True)
|
||||
plist.write(sys.stdout, encoding="utf-8", xml_declaration=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue