remove exception to black line-length and reformat.

This commit is contained in:
fiatjaf
2021-03-24 00:40:32 -03:00
parent 3333f1f3f3
commit 42bd5ea989
92 changed files with 1341 additions and 330 deletions
+15 -5
View File
@@ -20,15 +20,21 @@ class Extension(NamedTuple):
class ExtensionManager:
def __init__(self):
self._disabled: List[str] = LNBITS_DISABLED_EXTENSIONS
self._extension_folders: List[str] = [x[1] for x in os.walk(os.path.join(LNBITS_PATH, "extensions"))][0]
self._extension_folders: List[str] = [
x[1] for x in os.walk(os.path.join(LNBITS_PATH, "extensions"))
][0]
@property
def extensions(self) -> List[Extension]:
output = []
for extension in [ext for ext in self._extension_folders if ext not in self._disabled]:
for extension in [
ext for ext in self._extension_folders if ext not in self._disabled
]:
try:
with open(os.path.join(LNBITS_PATH, "extensions", extension, "config.json")) as json_file:
with open(
os.path.join(LNBITS_PATH, "extensions", extension, "config.json")
) as json_file:
config = json.load(json_file)
is_valid = True
except Exception:
@@ -50,7 +56,9 @@ class ExtensionManager:
def get_valid_extensions() -> List[Extension]:
return [extension for extension in ExtensionManager().extensions if extension.is_valid]
return [
extension for extension in ExtensionManager().extensions if extension.is_valid
]
def urlsafe_short_hash() -> str:
@@ -91,7 +99,9 @@ def get_css_vendored(prefer_minified: bool = False) -> List[str]:
def get_vendored(ext: str, prefer_minified: bool = False) -> List[str]:
paths: List[str] = []
for path in glob.glob(os.path.join(LNBITS_PATH, "static/vendor/**"), recursive=True):
for path in glob.glob(
os.path.join(LNBITS_PATH, "static/vendor/**"), recursive=True
):
if path.endswith(".min" + ext):
# path is minified
unminified = path.replace(".min" + ext, ext)