mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
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:
parent
f45051050e
commit
851ca30be5
30 changed files with 207 additions and 193 deletions
|
|
@ -76,13 +76,13 @@ class CmdTweet(Command):
|
|||
|
||||
tlen = len(tweet)
|
||||
if tlen > 280:
|
||||
caller.msg("Your tweet was %i chars long (max 280)." % tlen)
|
||||
caller.msg(f"Your tweet was {tlen} chars long (max 280).")
|
||||
return
|
||||
|
||||
# post the tweet
|
||||
TWITTER_API.PostUpdate(tweet)
|
||||
|
||||
caller.msg("You tweeted:\n%s" % tweet)
|
||||
caller.msg(f"You tweeted:\n{tweet}")
|
||||
```
|
||||
|
||||
Be sure to substitute your own actual API/Access keys and secrets in the appropriate places.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue