Skip to content

Commit

Permalink
blackize
Browse files Browse the repository at this point in the history
  • Loading branch information
reinhrst committed Oct 31, 2023
1 parent 50fcaf5 commit 4e42944
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion bot.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import json
import logging
import os
from sanitize import sanitize

import discord
from pytz import timezone

from sanitize import sanitize

discord_token = os.getenv("DISCORD_TOKEN")

# Logging configuration
Expand Down
8 changes: 5 additions & 3 deletions sanitize.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import re

safe = "abcdefghijklmnopqrstuvwxyz01234567890-_ .,"
tomap = ("éàèùçâêîôûëïüąćęłńóśźżříšžčýůňúěďáéäüößœ",
(*"eaeucaeioueiuacelnoszzriszcyunuedae",
"ae", "ue", "oe", "ss", "oe"))
tomap = (
"éàèùçâêîôûëïüąćęłńóśźżříšžčýůňúěďáéäüößœ",
(*"eaeucaeioueiuacelnoszzriszcyunuedae", "ae", "ue", "oe", "ss", "oe"),
)
map = {
**{c: c for c in safe + safe.upper()},
**{s: d for (s, d) in zip(*tomap)},
Expand All @@ -16,6 +17,7 @@ def sanitize(s):


if __name__ == "__main__":

def test(s):
print(f"{s} --> {sanitize(s)}")
print(f"{s.upper()} --> {sanitize(s.upper())}")
Expand Down

0 comments on commit 4e42944

Please sign in to comment.