From 92bf2228681a9e33620082b8a3c8f44f564ceed2 Mon Sep 17 00:00:00 2001 From: mathewguest Date: Wed, 18 Aug 2021 21:47:27 -0600 Subject: [PATCH] fixed config path for windows --- edit-config-windows.ps1 | 38 ++++++++++++++++++++++++++++++++++++++ smileyface/app.py | 4 ++-- smileyface/config.spec | 32 +++++++++++--------------------- 3 files changed, 51 insertions(+), 23 deletions(-) create mode 100644 edit-config-windows.ps1 diff --git a/edit-config-windows.ps1 b/edit-config-windows.ps1 new file mode 100644 index 0000000..b36e213 --- /dev/null +++ b/edit-config-windows.ps1 @@ -0,0 +1,38 @@ +# Opens hie_parser configuration file in the default editor, creating file +# if necessary. + +$config_filepath = Join-Path -Path "$env:USERPROFILE" -ChildPath "\AppData\Local\smileyface-ut4\hub_config.ini" + +$dir_path = Split-Path -Path "$config_filepath" + + +# Create config directory if necessary: +if (!(Test-Path "$dir_path" -Type Container)) +{ + Write-Host "Creating config directory: $dir_path" + New-Item -ItemType "directory" -Path "$dir_path" > $null + Write-Host +} + +# Create config.ini if necessary: +if (!(Test-Path "$config_filepath" -Type Leaf)) +{ + Write-Host "Creating new config.ini: $config_filepath" + New-Item -Path "$config_filepath" > $null + Set-Content "$config_filepath" @" + + +"@ +} + +# Open config.ini in favorite text editor: +Write-Host "Opening covid_parser configuration in your system-default editor" +Write-Host "Configuration file: $config_filepath" +Invoke-Item "$config_filepath" + +# Leave terminal open after done: +if ($Host.Name -eq "ConsoleHost") +{ + Write-Host "Done." + $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyUp") > $null +} diff --git a/smileyface/app.py b/smileyface/app.py index d6e161e..cdca9bd 100644 --- a/smileyface/app.py +++ b/smileyface/app.py @@ -10,13 +10,13 @@ class SmileyFace(app_skellington.ApplicationContainer): config_filepath = self._get_config_filepath( 'smileyface-ut4', - 'app_author', + '', 'hub-config.ini' ) super().__init__( configspec_filepath=self.configspec_filepath, - config_filepath=config_filepath, + configini_filepath=config_filepath, app_name = 'SmileyFace UT4 Server Panel', app_author = 'Mathew Guest', app_version = '0.1', diff --git a/smileyface/config.spec b/smileyface/config.spec index 5c27b03..f84797b 100644 --- a/smileyface/config.spec +++ b/smileyface/config.spec @@ -1,24 +1,14 @@ [app] - project_dir = string(max=255, default='') - - config_dir = string(max=255, default='') - - download_url = string(max=255, default='https://s3.amazonaws.com/unrealtournament/ShippedBuilds/%2B%2BUT%2BRelease-Next-CL-3525360/UnrealTournament-Server-XAN-3525360-Linux.zip') - - download_filename = string(max=255, default='UnrealTournament-Server-XAN-3525360-Linux.zip') - - download_md5 = string(max=255, default='cad730ad6793ba6261f9a341ad7396eb') - - skip_validate = boolean(default=False) - - redirect_protocol = string(max=255, default='') - - redirect_url = string(max=255, default='') - - remote_game_host = string(max=255, default='') - - remote_game_dir = string(max=255, default='') - - remote_redirect_host = string(max=255, default='') +project_dir = string(max=255, default='') +config_dir = string(max=255, default='') +download_url = string(max=255, default='https://s3.amazonaws.com/unrealtournament/ShippedBuilds/%2B%2BUT%2BRelease-Next-CL-3525360/UnrealTournament-Server-XAN-3525360-Linux.zip') +download_filename = string(max=255, default='UnrealTournament-Server-XAN-3525360-Linux.zip') +download_md5 = string(max=255, default='cad730ad6793ba6261f9a341ad7396eb') +skip_validate = boolean(default=False) +redirect_protocol = string(max=255, default='') +redirect_url = string(max=255, default='') +remote_game_host = string(max=255, default='') +remote_game_dir = string(max=255, default='') +remote_redirect_host = string(max=255, default='') [logging]