release 1.0.0
- bump python-version to 3.14 - bump streamlit to 1.52.2 - bump numpy to 2.4.0 - extra-script for generating special-wb's - rework of container to use a python-virtual-environment and create the special-wb's at first start of the container (no longer at first web-request) - adding links to source-code and docker-registry's in welcome-message - some more error-handling for ADFG(V)X
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
# Licensed under the MIT License. See LICENSE file in the project root.
|
||||
import math
|
||||
from re import match # für unkennify
|
||||
|
||||
import folium
|
||||
import streamlit as st
|
||||
from streamlit_folium import st_folium
|
||||
import folium
|
||||
import os
|
||||
|
||||
|
||||
# ***recursive quersummenfunktion***
|
||||
@@ -176,70 +176,6 @@ def unkennify(text):
|
||||
decoded = decoded + text[i:]
|
||||
return decoded
|
||||
|
||||
def generate_special_files():
|
||||
out="\n\n\n"
|
||||
if os.path.exists("./data/morse-de.dic"):
|
||||
pass
|
||||
else:
|
||||
remorse_generate_morsede()
|
||||
out+=":blue[deutsches Re-Morse-Wörterbuch wurde generiert] \n"
|
||||
if os.path.exists("./data/t9-de.dic"):
|
||||
pass
|
||||
else:
|
||||
t9_generate_t9de()
|
||||
out+=":blue[deutsches T9-Wörterbuch wurde generiert] \n"
|
||||
return out
|
||||
|
||||
def remorse_generate_morsede():
|
||||
alphabet = {'A': '.-', 'B': '-...', 'C': '-.-.', 'D': '-..', 'E': '.', 'F': '..-.', 'G': '--.',
|
||||
'H': '....', 'I': '..', 'J': '.---', 'K': '-.-', 'L': '.-..', 'M': '--', 'N': '-.',
|
||||
'O': '---', 'P': '.--.', 'Q': '--.-', 'R': '.-.', 'S': '...', 'T': '-', 'U': '..-',
|
||||
'V': '...-', 'W': '.--', 'X': '-..-', 'Y': '-.--', 'Z': '--..', '1': '.----',
|
||||
'2': '..---', '3': '...--', '4': '....-', '5': '.....', '6': '-....', '7': '--...',
|
||||
'8': '---..', '9': '----.', '0': '-----', 'Ñ': '--.--', 'É': '..-..', 'È': '.-..-',
|
||||
'À': '.--.-', 'Ü': '..--', 'Ö': '---.', 'Ä': '.-.-', '_': '..--.-', '@': '.--.-.',
|
||||
'?': '..--..', '=': '-...-', ';': '-.-.-.', ':': '---...', '/': '-..-.',
|
||||
'.': '.-.-.-', '-': '-....-', ',': '--..--', '+': '.-.-.', ')': '-.--.-',
|
||||
'(': '-.--.', "'": '.----.', 'SS': '...--..'}
|
||||
with open("./data/morse-de.dic", "w", encoding="iso-8859-1") as ofile:
|
||||
for symbol, morse in alphabet.items():
|
||||
ofile.write(f"{morse},{symbol}\n")
|
||||
with open("./data/german.dic", "r", encoding="iso-8859-1") as infile:
|
||||
for line in infile:
|
||||
word = line.strip()
|
||||
try:
|
||||
morse_word = ''.join(alphabet[char.upper()] for char in word)
|
||||
ofile.write(f"{morse_word},{word}\n")
|
||||
except KeyError:
|
||||
# Überspringe Wörter mit nicht-unterstützten Zeichen
|
||||
continue
|
||||
infile.close()
|
||||
ofile.close()
|
||||
|
||||
def t9_generate_t9de():
|
||||
alphabet = {'A': '2', 'B': '2', 'C': '2', 'D': '3', 'E': '3', 'F': '3', 'G': '4',
|
||||
'H': '4', 'I': '4', 'J': '5', 'K': '5', 'L': '5', 'M': '6', 'N': '6',
|
||||
'O': '6', 'P': '7', 'Q': '7', 'R': '7', 'S': '7', 'T': '8', 'U': '8',
|
||||
'V': '8', 'W': '9', 'X': '9', 'Y': '9', 'Z': '9', '1': '1', '2': '2',
|
||||
'3': '3', '4': '4', '5': '5', '6': '6', '7': '7', '8': '8', '9': '9',
|
||||
'0': '0', 'Ñ': '6', 'É': '3', 'È': '3', 'À': '2', 'Ü': '8', 'Ö': '6',
|
||||
'Ä': '2', '@': '1', '?': '1', '=': '0', ':': '1', '/': '1', '.': '1',
|
||||
'-': '1', ',': '1', '+': '0', ')': '1', '(': '1', 'SS': '7'}
|
||||
ofile = open("./data/t9-de.dic", "a", encoding="iso-8859-15")
|
||||
file = open("./data/german.dic", "r", encoding="iso-8859-15")
|
||||
for zeile in file:
|
||||
omsg = ""
|
||||
zeile = zeile.rstrip()
|
||||
try:
|
||||
for char in zeile:
|
||||
omsg = omsg + alphabet[char.upper()]
|
||||
except KeyError:
|
||||
continue
|
||||
else:
|
||||
ofile.write(omsg + "," + zeile + "\n")
|
||||
file.close()
|
||||
ofile.close()
|
||||
|
||||
def rail_encrypt(plain_text: str, rails: int):
|
||||
arr = [["" for _ in range(len(plain_text))] for _ in range(rails)]
|
||||
r = 0
|
||||
@@ -293,10 +229,10 @@ def rail_decrypt(cipher: str, rails: int):
|
||||
y -= 1
|
||||
elif down:
|
||||
y += 1
|
||||
elif down is False and y == 0:
|
||||
elif not down and y == 0:
|
||||
down = True
|
||||
y += 1
|
||||
elif down is False:
|
||||
elif not down:
|
||||
y -= 1
|
||||
return out
|
||||
#from folium.map import DivIcon
|
||||
@@ -329,4 +265,4 @@ def show_map_folium(df):
|
||||
# Schritt 5: In Streamlit anzeigen
|
||||
st_folium(m, use_container_width=True)
|
||||
else:
|
||||
st.markdown(":red[Keine sinnvoll darstellbaren Koordinaten gefunden]")
|
||||
st.markdown(":red[Keine sinnvoll darstellbaren Koordinaten gefunden]")
|
||||
|
||||
Reference in New Issue
Block a user