diff --git a/afu/callbook.py b/afu/callbook.py index f2aa79d..334f97f 100755 --- a/afu/callbook.py +++ b/afu/callbook.py @@ -111,7 +111,7 @@ def is_clubstation(call): def replace_substring_with_line(path, search_substring, verbose=0): - + try: if not replace_substring_with_line.lines: with open(path, 'r') as file: @@ -119,11 +119,7 @@ def replace_substring_with_line(path, search_substring, verbose=0): for line in replace_substring_with_line.lines: if search_substring[0:46].lower() in line.lower(): - modified_line = line.strip() - # Replace the substring with the whole line - ## line = line.lower().replace(search_substring.lower(), modified_line) - modified_line = line - return modified_line + return line.strip() except FileNotFoundError: print(f'The file {path} was not found.') @@ -233,7 +229,7 @@ def fix_typo(call, fullname, verbose=1): fix_typo.spaces = [line.index(words[1]), line.index(words[2]), line.index(words[3])] else: if call in line[2:8]: - if verbose > 0: + if verbose > 1: print(f'Call: {call} found') match line[0]: case '#': @@ -241,8 +237,8 @@ def fix_typo(call, fullname, verbose=1): print(line.rstrip()) case 'F': if verbose > 0: - print(fullname) print(line.rstrip()) + print(fullname) firstname1, surname1, gender1 = call_split_name(fullname, call, 0) fullname2 = line[fix_typo.spaces[1]:fix_typo.spaces[2]-1].rstrip() + ' ' + line[fix_typo.spaces[2]:-1] if verbose > 0: @@ -262,8 +258,8 @@ def fix_typo(call, fullname, verbose=1): fullname = fullname2 case 'X': # exchange the surname with firstname if verbose > 0: - print(fullname) print(line.rstrip()) + print(fullname) firstname1, surname1, gender1 = call_split_name(fullname, call, 0) fullname2 = line[fix_typo.spaces[1]:fix_typo.spaces[2]-1].rstrip() + ' ' + line[fix_typo.spaces[2]:-1] if verbose > 0: diff --git a/gitea/download_update_gitea.sh b/gitea/download_update_gitea.sh index 5670a97..1198510 100755 --- a/gitea/download_update_gitea.sh +++ b/gitea/download_update_gitea.sh @@ -2,7 +2,7 @@ # Script Updating Gitea (c) Thomas Kuschel # since 2024 -echo "Update the Gitea from the website and restart Gitea Service" +echo "Update the Gitea from the website and restart Gitea service" website_latest="https://github.com/go-gitea/gitea/releases/latest" website_uri="https://dl.gitea.io/gitea" @@ -24,15 +24,15 @@ fi version_active_raw=$( gitea --version ) version_active=$( gitea --version | awk '{ print $3; exit }' ) -echo "Website Version: ${version}" -echo " Active Version: ${version_active}" +echo "Website version: ${version}" +echo " Active version: ${version_active}" if [ "${version}" == "${version_active}" ] then - echo "Both Version Strings are Equal." + echo "Both version strings are the same." else - echo "Both Version Strings are not Equal." - echo "Start Updating..." + echo "There are differnces between the two version strings." + echo "Start updating..." read -p "Are you sure? (y/N)" -n 1 -r echo # (optional) move to a new line if [[ $REPLY =~ ^[YyJj]$ ]] @@ -56,9 +56,7 @@ else fi # remove local files: rm gitea gitea.sha256 - fi - fi #echo active gitea version: @@ -69,5 +67,5 @@ read -p "Restart the gitea service on the host? (y/N)" -n 1 -r if [[ $REPLY =~ ^[YyJj]$ ]] then sudo systemctl restart gitea.service - echo "Restarted gitea.service" + echo "gitea.service restarted." fi