mirror of
https://github.com/arcan1s/ahriman.git
synced 2026-02-24 13:49:48 +00:00
style: replace """ with " for single line strings
This commit is contained in:
@@ -251,7 +251,7 @@ class Setup(Handler):
|
|||||||
|
|
||||||
content = f"PACKAGER='{packager}'\n"
|
content = f"PACKAGER='{packager}'\n"
|
||||||
if makeflags_jobs:
|
if makeflags_jobs:
|
||||||
content += """MAKEFLAGS="-j$(nproc)"\n"""
|
content += "MAKEFLAGS=\"-j$(nproc)\"\n"
|
||||||
|
|
||||||
uid, _ = paths.root_owner
|
uid, _ = paths.root_owner
|
||||||
home_dir = Path(getpwuid(uid).pw_dir)
|
home_dir = Path(getpwuid(uid).pw_dir)
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ class OAuth(Mapping):
|
|||||||
Returns:
|
Returns:
|
||||||
str: login control as html code to insert
|
str: login control as html code to insert
|
||||||
"""
|
"""
|
||||||
return f"""<a class="nav-link" href="/api/v1/login" title="login via OAuth2"><i class="bi bi-{
|
return f"<a class=\"nav-link\" href=\"/api/v1/login\" title=\"login via OAuth2\"><i class=\"bi bi-{
|
||||||
self.icon}"></i> login</a>"""
|
self.icon}\"></i> login</a>"
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_provider(name: str) -> type[aioauth_client.OAuth2Client]:
|
def get_provider(name: str) -> type[aioauth_client.OAuth2Client]:
|
||||||
|
|||||||
@@ -375,7 +375,7 @@ class Package(LazyLogging):
|
|||||||
Returns:
|
Returns:
|
||||||
str: print-friendly string
|
str: print-friendly string
|
||||||
"""
|
"""
|
||||||
details = "" if self.is_single_package else f""" ({" ".join(sorted(self.packages.keys()))})"""
|
details = "" if self.is_single_package else f" ({" ".join(sorted(self.packages.keys()))})"
|
||||||
return f"{self.base}{details}"
|
return f"{self.base}{details}"
|
||||||
|
|
||||||
def vercmp(self, version: str) -> int:
|
def vercmp(self, version: str) -> int:
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ class PkgbuildPatch:
|
|||||||
"""
|
"""
|
||||||
if "$" in source:
|
if "$" in source:
|
||||||
# copy from library method with double quotes instead
|
# copy from library method with double quotes instead
|
||||||
return f"""\"{source.replace("\"", "'\"'")}\""""
|
return f"\"{source.replace("\"", "'\"'")}\""
|
||||||
# otherwise just return normal call
|
# otherwise just return normal call
|
||||||
return shlex.quote(source)
|
return shlex.quote(source)
|
||||||
|
|
||||||
@@ -195,13 +195,13 @@ class PkgbuildPatch:
|
|||||||
"""
|
"""
|
||||||
if isinstance(self.value, list): # list like
|
if isinstance(self.value, list): # list like
|
||||||
value = " ".join(map(self.quote, self.value))
|
value = " ".join(map(self.quote, self.value))
|
||||||
return f"""{self.key}=({value})"""
|
return f"{self.key}=({value})"
|
||||||
if self.is_plain_diff: # no additional logic for plain diffs
|
if self.is_plain_diff: # no additional logic for plain diffs
|
||||||
return self.value
|
return self.value
|
||||||
# we suppose that function values are only supported in string-like values
|
# we suppose that function values are only supported in string-like values
|
||||||
if self.is_function:
|
if self.is_function:
|
||||||
return f"{self.key} {self.value}" # no quoting enabled here
|
return f"{self.key} {self.value}" # no quoting enabled here
|
||||||
return f"""{self.key}={self.quote(self.value)}"""
|
return f"{self.key}={self.quote(self.value)}"
|
||||||
|
|
||||||
def substitute(self, variables: dict[str, str]) -> str | list[str]:
|
def substitute(self, variables: dict[str, str]) -> str | list[str]:
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user