home
·
contact
·
privacy
projects
/
ircplom
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
37e7603
)
For log file names, escape anything but the most boring characters.
author
Christian Heller
<c.heller@plomlompom.de>
Thu, 25 Sep 2025 19:11:01 +0000
(21:11 +0200)
committer
Christian Heller
<c.heller@plomlompom.de>
Thu, 25 Sep 2025 19:11:01 +0000
(21:11 +0200)
src/ircplom/client_tui.py
patch
|
blob
|
history
diff --git
a/src/ircplom/client_tui.py
b/src/ircplom/client_tui.py
index dbdd4985d3589d7da7b1d2abd8c705fa5fed0dc1..5413577a1a47424f486bb7f8b6016c08c17ccdec 100644
(file)
--- a/
src/ircplom/client_tui.py
+++ b/
src/ircplom/client_tui.py
@@
-45,7
+45,15
@@
class _ClientWindow(Window, ClientQueueMixin):
def log(self, msg: str) -> None:
super().log(msg)
- ldir = _PATH_LOGS.joinpath(self._title)
+ escaped = ''
+ for char in self._title:
+ if (char.isalpha() and char.isascii()) or char in '-.':
+ escaped += char
+ else:
+ escaped += '_'
+ escaped += '.'.join(str(int(b)) for b in char.encode('utf8'))
+ escaped += '_'
+ ldir = _PATH_LOGS.joinpath(escaped)
if not ldir.exists():
ldir.mkdir(parents=True)
assert ldir.is_dir()