Reformat with Black

No functional changes.
This commit is contained in:
2021-02-16 11:21:06 +01:00
parent 883f125722
commit 8b49c5505e
27 changed files with 3094 additions and 2288 deletions

View File

@@ -37,23 +37,26 @@ def load_wheel(module_name, fname_prefix):
try:
module = __import__(module_name)
except ImportError as ex:
log.debug('Unable to import %s directly, will try wheel: %s',
module_name, ex)
log.debug("Unable to import %s directly, will try wheel: %s", module_name, ex)
else:
log.debug('Was able to load %s from %s, no need to load wheel %s',
module_name, module.__file__, fname_prefix)
log.debug(
"Was able to load %s from %s, no need to load wheel %s",
module_name,
module.__file__,
fname_prefix,
)
return
sys.path.append(wheel_filename(fname_prefix))
module = __import__(module_name)
log.debug('Loaded %s from %s', module_name, module.__file__)
log.debug("Loaded %s from %s", module_name, module.__file__)
def wheel_filename(fname_prefix: str) -> str:
path_pattern = os.path.join(my_dir, '%s*.whl' % fname_prefix)
path_pattern = os.path.join(my_dir, "%s*.whl" % fname_prefix)
wheels = glob.glob(path_pattern)
if not wheels:
raise RuntimeError('Unable to find wheel at %r' % path_pattern)
raise RuntimeError("Unable to find wheel at %r" % path_pattern)
# If there are multiple wheels that match, load the latest one.
wheels.sort()
@@ -61,7 +64,7 @@ def wheel_filename(fname_prefix: str) -> str:
def load_wheels():
load_wheel('blender_asset_tracer', 'blender_asset_tracer')
load_wheel('lockfile', 'lockfile')
load_wheel('cachecontrol', 'CacheControl')
load_wheel('pillarsdk', 'pillarsdk')
load_wheel("blender_asset_tracer", "blender_asset_tracer")
load_wheel("lockfile", "lockfile")
load_wheel("cachecontrol", "CacheControl")
load_wheel("pillarsdk", "pillarsdk")