Skip to content

Commit

Permalink
ruff check --fix
Browse files Browse the repository at this point in the history
  • Loading branch information
reinout committed Oct 1, 2024
1 parent 1b32649 commit f6131eb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion shell/dos2unix.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def unix2dos(data):


def confirm(file_):
s = raw_input("%s? " % file_)
s = raw_input(f"{file_}? ")
return s and s[0] == "y"


Expand Down
2 changes: 1 addition & 1 deletion tools/add_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ def main():

out_filename = date_string.replace(":", "_") + ".png"
image.save(out_filename, "png")
print("Saved %s" % out_filename)
print(f"Saved {out_filename}")
8 changes: 4 additions & 4 deletions tools/blog.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def copytoblog():
print("pass along filename!")
filename = sys.argv[1]
if not os.path.exists(filename):
print("%s doesn't exist" % filename)
print(f"{filename} doesn't exist")

now = datetime.now()
y = "%04d" % now.year
Expand Down Expand Up @@ -100,7 +100,7 @@ def copytoblog():
webbrowser.open(on_site)
if "y" in input("Delete file in ~/blog/? [y/N] "):
os.remove(os.path.join(os.path.expanduser("~/blog"), filename))
print("%s removed" % filename)
print(f"{filename} removed")


def makedocs():
Expand Down Expand Up @@ -137,7 +137,7 @@ def list_todays_entries():
monthdir = os.path.join(yeardir, m)
daydir = os.path.join(monthdir, d)
if not os.path.exists(daydir):
print("Nothing posted yet in %s" % daydir)
print(f"Nothing posted yet in {daydir}")
sys.exit(1)
entries = [
entry
Expand Down Expand Up @@ -188,7 +188,7 @@ def new_sermon():
yeardir = os.path.join(SERMONSOURCE, yyyy)
if not os.path.exists(yeardir):
os.mkdir(yeardir)
print("Created %s" % yeardir)
print(f"Created {yeardir}")

title = None
while not title:
Expand Down
4 changes: 2 additions & 2 deletions tools/mkinit.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ def main():
dirname = sys.argv[1]
if not os.path.exists(dirname):
os.mkdir(dirname)
print("Created directory %s" % dirname)
print(f"Created directory {dirname}")
initfile = os.path.join(dirname, "__init__.py")
if not os.path.exists(initfile):
open(initfile, "w").write("# package\n")
print("Created file %s" % initfile)
print(f"Created file {initfile}")

0 comments on commit f6131eb

Please sign in to comment.