1
0
Fork 0
forked from github/pelican

The ruff and ruff-format fixes

This commit is contained in:
boxydog 2024-05-30 09:05:36 -05:00
commit 6d8597addb
24 changed files with 48 additions and 79 deletions

View file

@ -22,7 +22,6 @@ from pelican.log import init
from pelican.settings import DEFAULT_CONFIG
from pelican.utils import SafeDatetime, slugify
logger = logging.getLogger(__name__)

View file

@ -169,7 +169,7 @@ def ask_timezone(question, default, tzurl):
r = tz_dict[r]
break
else:
print("Please enter a valid time zone:\n" " (check [{}])".format(tzurl))
print("Please enter a valid time zone:\n" f" (check [{tzurl}])")
return r
@ -205,14 +205,14 @@ def main():
args = parser.parse_args()
print(
"""Welcome to pelican-quickstart v{v}.
f"""Welcome to pelican-quickstart v{__version__}.
This script will help you create a new Pelican-based website.
Please answer the following questions so this script can generate the files
needed by Pelican.
""".format(v=__version__)
"""
)
project = os.path.join(os.environ.get("VIRTUAL_ENV", os.curdir), ".project")

View file

@ -240,15 +240,11 @@ def install(path, v=False, u=False):
except OSError as e:
err(
"Cannot change permissions of files "
"or directory in `{r}':\n{e}".format(r=theme_path, e=str(e)),
f"or directory in `{theme_path}':\n{e!s}",
die=False,
)
except Exception as e:
err(
"Cannot copy `{p}' to `{t}':\n{e}".format(
p=path, t=theme_path, e=str(e)
)
)
err(f"Cannot copy `{path}' to `{theme_path}':\n{e!s}")
def symlink(path, v=False):
@ -268,11 +264,7 @@ def symlink(path, v=False):
try:
os.symlink(path, theme_path)
except Exception as e:
err(
"Cannot link `{p}' to `{t}':\n{e}".format(
p=path, t=theme_path, e=str(e)
)
)
err(f"Cannot link `{path}' to `{theme_path}':\n{e!s}")
def is_broken_link(path):