From d14cae20f1df8dba409e049abb780825fd3713b0 Mon Sep 17 00:00:00 2001 From: Anton Lysakov Date: Wed, 27 Mar 2019 20:59:42 +0700 Subject: [PATCH] fix path to configs --- lib/tuilib.py | 9 +++++---- rogue_tui.py | 2 +- tetris_tui.py | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/tuilib.py b/lib/tuilib.py index c038206..4b5f1a1 100755 --- a/lib/tuilib.py +++ b/lib/tuilib.py @@ -1920,16 +1920,17 @@ def warrior_trasnfer(rpc_connection): print(colorize("Choose y or n!", "red")) -def check_if_config_is_here(rpc_connection, config_name): +def check_if_config_is_here(rpc_connection, assetchain_name): + config_name = assetchain_name + ".conf" if os.path.exists(config_name): print(colorize("Config is already in daemon folder", "green")) else: if operating_system == 'Darwin': - path_to_config = os.environ['HOME'] + '/Library/Application Support/Komodo/ROGUE/' + config_name + path_to_config = os.environ['HOME'] + '/Library/Application Support/Komodo/' + assetchain_name + '/' + config_name elif operating_system == 'Linux': - path_to_config = os.environ['HOME'] + '/.komodo/ROGUE/' + config_name + path_to_config = os.environ['HOME'] + '/.komodo/' + assetchain_name + '/' + config_name elif operating_system == 'Win64' or operating_system == 'Windows': - path_to_config = '%s/komodo/ROGUE/' + config_name % os.environ['APPDATA'] + path_to_config = '%s/komodo/' + assetchain_name + '/' + config_name % os.environ['APPDATA'] try: copy(path_to_config, os.getcwd()) except Exception as e: diff --git a/rogue_tui.py b/rogue_tui.py index f9feebd..9942369 100755 --- a/rogue_tui.py +++ b/rogue_tui.py @@ -101,7 +101,7 @@ def main(): rpc_connection.setpubkey(valid_pubkey) print(tuilib.colorize("Pubkey is succesfully set!", "green")) # copy ROGUE config to current daemon directory if it's not here - tuilib.check_if_config_is_here(rpc_connection, "ROGUE.conf") + tuilib.check_if_config_is_here(rpc_connection, "ROGUE") except Exception: print(tuilib.colorize("Cant connect to ROGUE daemon RPC! Please check if daemon is up.", "pink")) tuilib.exit() diff --git a/tetris_tui.py b/tetris_tui.py index 5e0f704..3c42d4d 100755 --- a/tetris_tui.py +++ b/tetris_tui.py @@ -81,7 +81,7 @@ def main(): rpc_connection.setpubkey(valid_pubkey) print(tuilib.colorize("Pubkey is succesfully set!", "green")) # copy ROGUE config to current daemon directory if it's not here - tuilib.check_if_config_is_here(rpc_connection, "GTEST.conf") + tuilib.check_if_config_is_here(rpc_connection, "GTEST") except Exception: print(tuilib.colorize("Cant connect to GTEST daemon RPC! Please check if daemon is up.", "pink")) tuilib.exit()