mirror of
https://github.com/arcan1s/ahriman.git
synced 2026-02-24 21:59: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"
|
||||
if makeflags_jobs:
|
||||
content += """MAKEFLAGS="-j$(nproc)"\n"""
|
||||
content += "MAKEFLAGS=\"-j$(nproc)\"\n"
|
||||
|
||||
uid, _ = paths.root_owner
|
||||
home_dir = Path(getpwuid(uid).pw_dir)
|
||||
|
||||
@@ -69,8 +69,8 @@ class OAuth(Mapping):
|
||||
Returns:
|
||||
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-{
|
||||
self.icon}"></i> login</a>"""
|
||||
return f"<a class=\"nav-link\" href=\"/api/v1/login\" title=\"login via OAuth2\"><i class=\"bi bi-{
|
||||
self.icon}\"></i> login</a>"
|
||||
|
||||
@staticmethod
|
||||
def get_provider(name: str) -> type[aioauth_client.OAuth2Client]:
|
||||
|
||||
@@ -375,7 +375,7 @@ class Package(LazyLogging):
|
||||
Returns:
|
||||
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}"
|
||||
|
||||
def vercmp(self, version: str) -> int:
|
||||
|
||||
@@ -147,7 +147,7 @@ class PkgbuildPatch:
|
||||
"""
|
||||
if "$" in source:
|
||||
# copy from library method with double quotes instead
|
||||
return f"""\"{source.replace("\"", "'\"'")}\""""
|
||||
return f"\"{source.replace("\"", "'\"'")}\""
|
||||
# otherwise just return normal call
|
||||
return shlex.quote(source)
|
||||
|
||||
@@ -195,13 +195,13 @@ class PkgbuildPatch:
|
||||
"""
|
||||
if isinstance(self.value, list): # list like
|
||||
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
|
||||
return self.value
|
||||
# we suppose that function values are only supported in string-like values
|
||||
if self.is_function:
|
||||
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]:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user