aboutsummaryrefslogtreecommitdiff
path: root/src/utils/irc.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-11-18 14:16:30 +0000
committerGravatar jesopo2019-11-18 14:16:30 +0000
commitfe25c6bc26ae46c81103ac89d3d1c7744f93cb92 (patch)
treea38f35ebb6cabc73fac7c16464cd2ad5f2ecf15a /src/utils/irc.py
parenttruncate nickname hash operations to 64bit (diff)
signature
switch some utils.irc functions to use f-strings
Diffstat (limited to 'src/utils/irc.py')
-rw-r--r--src/utils/irc.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/utils/irc.py b/src/utils/irc.py
index d185a52b..762b6b7a 100644
--- a/src/utils/irc.py
+++ b/src/utils/irc.py
@@ -38,8 +38,7 @@ def color(s: str, foreground: consts.IRCColor,
if background:
background_s = ",%s" % str(background.irc).zfill(2)
- return "%s%s%s%s%s" % (consts.COLOR, foreground_s, background_s, s,
- consts.COLOR)
+ return f"{consts.COLOR}{foreground_s}{background_s}{s}{consts.COLOR}"
HASH_STOP = ["_", "|", "["]
HASH_COLORS = [consts.CYAN, consts.PURPLE, consts.GREEN, consts.ORANGE,
@@ -55,10 +54,10 @@ def hash_colorize(s: str):
return color(s, HASH_COLORS[hash%len(HASH_COLORS)])
def bold(s: str) -> str:
- return "%s%s%s" % (consts.BOLD, s, consts.BOLD)
+ return f"{consts.BOLD}{s}{consts.BOLD}"
def underline(s: str) -> str:
- return "%s%s%s" % (consts.UNDERLINE, s, consts.UNDERLINE)
+ return f"{consts.UNDERLINE}{s}{consts.UNDERLINE}"
def strip_font(s: str) -> str:
s = s.replace(consts.BOLD, "")