From ee07600546840e0ad004eda743c469931f276fb5 Mon Sep 17 00:00:00 2001 From: "Schimon Jehudah, Adv." Date: Wed, 20 Nov 2024 15:19:10 +0200 Subject: [PATCH] Check whether file settings.toml exists. --- jabbercard/__main__.py | 4 ++++ jabbercard/configs/settings.toml | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/jabbercard/__main__.py b/jabbercard/__main__.py index 6f07125..7bdad4b 100644 --- a/jabbercard/__main__.py +++ b/jabbercard/__main__.py @@ -48,6 +48,10 @@ if __name__ == 'jabbercard.__main__': # Configure settings file file_settings = os.path.join(directory_settings, 'settings.toml') + if not os.path.exists(file_settings): + directory_configs = os.path.join(directory, 'configs') + file_settings_empty = os.path.join(directory_configs, 'settings.toml') + shutil.copyfile(file_settings_empty, file_settings) data_settings = Toml.open_file_toml(file_settings) # Configure account diff --git a/jabbercard/configs/settings.toml b/jabbercard/configs/settings.toml index 4b433af..027cfc6 100644 --- a/jabbercard/configs/settings.toml +++ b/jabbercard/configs/settings.toml @@ -1,9 +1,9 @@ -# An account to connect FASI to the XMPP network +# JabberCard configuration file [account] -alias = "FASI" # Alias -xmpp = "" # Jabber ID -pass = "" # Password +alias = "JabberCard" # Alias +xmpp = "" # Jabber ID +pass = "" # Password [brand] name = "XMPP" # Name of brand