Cleanup: use static sets
This commit is contained in:
parent
42df2a7b57
commit
27b37517f8
|
@ -168,7 +168,7 @@ def function_parm_wash_tokens(parm):
|
||||||
# if tokens[-1].kind == To
|
# if tokens[-1].kind == To
|
||||||
# remove trailing char
|
# remove trailing char
|
||||||
if tokens[-1].kind == TokenKind.PUNCTUATION:
|
if tokens[-1].kind == TokenKind.PUNCTUATION:
|
||||||
if tokens[-1].spelling in (",", ")", ";"):
|
if tokens[-1].spelling in {",", ")", ";"}:
|
||||||
tokens.pop()
|
tokens.pop()
|
||||||
# else:
|
# else:
|
||||||
# print(tokens[-1].spelling)
|
# print(tokens[-1].spelling)
|
||||||
|
@ -179,7 +179,7 @@ def function_parm_wash_tokens(parm):
|
||||||
t_spelling = t.spelling
|
t_spelling = t.spelling
|
||||||
ok = True
|
ok = True
|
||||||
if t_kind == TokenKind.KEYWORD:
|
if t_kind == TokenKind.KEYWORD:
|
||||||
if t_spelling in ("const", "restrict", "volatile"):
|
if t_spelling in {"const", "restrict", "volatile"}:
|
||||||
ok = False
|
ok = False
|
||||||
elif t_spelling.startswith("__"):
|
elif t_spelling.startswith("__"):
|
||||||
ok = False # __restrict
|
ok = False # __restrict
|
||||||
|
|
|
@ -496,7 +496,7 @@ class DisplayPanel(BrushPanel):
|
||||||
icon='HIDE_OFF' if brush.use_cursor_overlay else 'HIDE_ON',
|
icon='HIDE_OFF' if brush.use_cursor_overlay else 'HIDE_ON',
|
||||||
)
|
)
|
||||||
|
|
||||||
if mode in ['PAINT_2D', 'PAINT_TEXTURE', 'PAINT_VERTEX', 'SCULPT']:
|
if mode in {'PAINT_2D', 'PAINT_TEXTURE', 'PAINT_VERTEX', 'SCULPT'}:
|
||||||
row = col.row(align=True)
|
row = col.row(align=True)
|
||||||
row.prop(brush, "texture_overlay_alpha", text="Texture Opacity")
|
row.prop(brush, "texture_overlay_alpha", text="Texture Opacity")
|
||||||
row.prop(brush, "use_primary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
|
row.prop(brush, "use_primary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
|
||||||
|
@ -506,7 +506,7 @@ class DisplayPanel(BrushPanel):
|
||||||
icon='HIDE_OFF' if brush.use_primary_overlay else 'HIDE_ON',
|
icon='HIDE_OFF' if brush.use_primary_overlay else 'HIDE_ON',
|
||||||
)
|
)
|
||||||
|
|
||||||
if mode in ['PAINT_TEXTURE', 'PAINT_2D']:
|
if mode in {'PAINT_TEXTURE', 'PAINT_2D'}:
|
||||||
row = col.row(align=True)
|
row = col.row(align=True)
|
||||||
row.prop(brush, "mask_overlay_alpha", text="Mask Texture Opacity")
|
row.prop(brush, "mask_overlay_alpha", text="Mask Texture Opacity")
|
||||||
row.prop(brush, "use_secondary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
|
row.prop(brush, "use_secondary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
|
||||||
|
|
|
@ -206,7 +206,7 @@ class TestConfig:
|
||||||
# Optimization to avoid rebuilds.
|
# Optimization to avoid rebuilds.
|
||||||
revisions_to_build = set()
|
revisions_to_build = set()
|
||||||
for entry in entries:
|
for entry in entries:
|
||||||
if entry.status in ('queued', 'outdated'):
|
if entry.status in {'queued', 'outdated'}:
|
||||||
revisions_to_build.add(entry.git_hash)
|
revisions_to_build.add(entry.git_hash)
|
||||||
self.queue.has_multiple_revisions_to_build = len(revisions_to_build) > 1
|
self.queue.has_multiple_revisions_to_build = len(revisions_to_build) > 1
|
||||||
|
|
||||||
|
@ -260,7 +260,7 @@ class TestConfig:
|
||||||
entry.executable = executable
|
entry.executable = executable
|
||||||
entry.benchmark_type = self.benchmark_type
|
entry.benchmark_type = self.benchmark_type
|
||||||
entry.date = date
|
entry.date = date
|
||||||
if entry.status in ('done', 'failed'):
|
if entry.status in {'done', 'failed'}:
|
||||||
entry.status = 'outdated'
|
entry.status = 'outdated'
|
||||||
else:
|
else:
|
||||||
# Add new entry if it did not exist yet.
|
# Add new entry if it did not exist yet.
|
||||||
|
|
|
@ -21,7 +21,7 @@ class TestGraph:
|
||||||
queue = TestQueue(json_filepath)
|
queue = TestQueue(json_filepath)
|
||||||
|
|
||||||
for entry in queue.entries:
|
for entry in queue.entries:
|
||||||
if entry.status in ('done', 'outdated'):
|
if entry.status in {'done', 'outdated'}:
|
||||||
device_name = entry.device_name + " (" + entry.device_type + ")"
|
device_name = entry.device_name + " (" + entry.device_type + ")"
|
||||||
if device_name in devices.keys():
|
if device_name in devices.keys():
|
||||||
devices[device_name].append(entry)
|
devices[device_name].append(entry)
|
||||||
|
|
|
@ -113,7 +113,7 @@ class OperatorSpecEditMode:
|
||||||
"""
|
"""
|
||||||
self.operator_name = operator_name
|
self.operator_name = operator_name
|
||||||
self.operator_parameters = operator_parameters
|
self.operator_parameters = operator_parameters
|
||||||
if select_mode not in ['VERT', 'EDGE', 'FACE']:
|
if select_mode not in {'VERT', 'EDGE', 'FACE'}:
|
||||||
raise ValueError("select_mode must be either {}, {} or {}".format('VERT', 'EDGE', 'FACE'))
|
raise ValueError("select_mode must be either {}, {} or {}".format('VERT', 'EDGE', 'FACE'))
|
||||||
self.select_mode = select_mode
|
self.select_mode = select_mode
|
||||||
self.selection = selection
|
self.selection = selection
|
||||||
|
|
Loading…
Reference in New Issue