mirror of
https://github.com/evennia/evennia.git
synced 2026-03-23 00: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
|
|
@ -66,16 +66,16 @@ command
|
|||
|
||||
keys = prototypes.keys()
|
||||
nprots = len(prototypes)
|
||||
tweet = "Prototype Count: %s Random Keys: " % nprots
|
||||
tweet = f"Prototype Count: {nprots} Random Keys: "
|
||||
|
||||
tweet += " %s" % keys[randint(0,len(keys)-1)]
|
||||
tweet += f" {keys[randint(0,len(keys)-1)]}"
|
||||
for x in range(0,2): ##tweet 3
|
||||
tweet += ", %s" % keys[randint(0,len(keys)-1)]
|
||||
tweet += f", {keys[randint(0,len(keys)-1)]}"
|
||||
# post the tweet
|
||||
try:
|
||||
response = api.PostUpdate(tweet)
|
||||
except:
|
||||
logger.log_trace("Tweet Error: When attempting to tweet %s" % tweet)
|
||||
logger.log_trace(f"Tweet Error: When attempting to tweet {tweet}")
|
||||
```
|
||||
|
||||
In the `at_script_creation` method, we configure the script to fire immediately (useful for testing)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue