issue #2243 -- prefer f-strings over %-interpolation

edited docs to prefer f-strings, then str.format(), and remove %-interpolation

additional ad-hoc documentation fixes, as opportunities seen:
- replace Built-In Function (BIF) "min" variable with "mins"
- prefer BIF str(var) over "%s" % var
- reformat some code examples to clarify multiple args passed to functions
- change some single-quote strings to double-quotes for consistency
- fix mismatched parens

misc edits:
- add .vscode/ to gitignore
This commit is contained in:
Dimitri 2021-10-12 12:13:42 -06:00
parent f45051050e
commit 851ca30be5
30 changed files with 207 additions and 193 deletions

View file

@ -246,8 +246,12 @@ def creating(request):
user.db._playable_characters.append(char)
# add the right locks for the character so the account can
# puppet it
char.locks.add("puppet:id(%i) or pid(%i) or perm(Developers) "
"or pperm(Developers)" % (char.id, user.id))
char.locks.add(" or ".join([
f"puppet:id({char.id})",
f"pid({user.id})",
"perm(Developers)",
"pperm(Developers)",
]))
char.db.background = background # set the character background
return HttpResponseRedirect('/chargen')
else:
@ -332,8 +336,12 @@ def creating(request):
user.db._playable_characters.append(char)
# add the right locks for the character so the account can
# puppet it
char.locks.add("puppet:id(%i) or pid(%i) or perm(Developers) "
"or pperm(Developers)" % (char.id, user.id))
char.locks.add(" or ".join([
f"puppet:id({char.id})",
f"pid({user.id})",
"perm(Developers)",
"pperm(Developers)",
]))
char.db.background = background # set the character background
return HttpResponseRedirect('/chargen')
else: