Cleanup: use static set syntax

This commit is contained in:
Campbell Barton
2021-05-28 16:05:46 +10:00
parent 6b03621c01
commit 3bee77bb7c
3 changed files with 4 additions and 4 deletions

View File

@@ -85,7 +85,7 @@ def openBlendFile(filename):
''' '''
handle = open(filename, 'rb') handle = open(filename, 'rb')
magic = ReadString(handle, 7) magic = ReadString(handle, 7)
if magic in ("BLENDER", "BULLETf"): if magic in {"BLENDER", "BULLETf"}:
log.debug("normal blendfile detected") log.debug("normal blendfile detected")
handle.seek(0, os.SEEK_SET) handle.seek(0, os.SEEK_SET)
return handle return handle
@@ -137,7 +137,7 @@ class BlendFile:
fileblock = BlendFileBlock(handle, self) fileblock = BlendFileBlock(handle, self)
found_dna_block = False found_dna_block = False
while not found_dna_block: while not found_dna_block:
if fileblock.Header.Code in ("DNA1", "SDNA"): if fileblock.Header.Code in {"DNA1", "SDNA"}:
self.Catalog = DNACatalog(self.Header, handle) self.Catalog = DNACatalog(self.Header, handle)
found_dna_block = True found_dna_block = True
else: else:

View File

@@ -164,7 +164,7 @@ class _defs_annotate:
gpl = context.active_annotation_layer gpl = context.active_annotation_layer
if gpl is not None: if gpl is not None:
layout.label(text="Annotation:") layout.label(text="Annotation:")
if context.space_data.type in ('VIEW_3D', 'SEQUENCE_EDITOR'): if context.space_data.type in {'VIEW_3D', 'SEQUENCE_EDITOR'}:
if region_type == 'TOOL_HEADER': if region_type == 'TOOL_HEADER':
sub = layout.split(align=True, factor=0.5) sub = layout.split(align=True, factor=0.5)
sub.ui_units_x = 6.5 sub.ui_units_x = 6.5

View File

@@ -62,7 +62,7 @@ def seek(r, txt, recurs):
# print(dir(r)) # print(dir(r))
# basic types # basic types
if type_r in (float, int, bool, type(None)): if type_r in {float, int, bool, type(None)}:
if PRINT_DATA: if PRINT_DATA:
print(txt + ' -> ' + str(r)) print(txt + ' -> ' + str(r))
return return