Skip to content

Commit

Permalink
modified config checker
Browse files Browse the repository at this point in the history
  • Loading branch information
tonymorony committed Mar 27, 2019
1 parent f614203 commit 9edfd93
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions lib/tuilib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1920,16 +1920,16 @@ def warrior_trasnfer(rpc_connection):
print(colorize("Choose y or n!", "red"))


def check_if_config_is_here(rpc_connection):
if os.path.exists("ROGUE.conf"):
def check_if_config_is_here(rpc_connection, config_name):
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/ROGUE.conf'
path_to_config = os.environ['HOME'] + '/Library/Application Support/Komodo/ROGUE/' + config_name
elif operating_system == 'Linux':
path_to_config = os.environ['HOME'] + '/.komodo/ROGUE/ROGUE.conf'
path_to_config = os.environ['HOME'] + '/.komodo/ROGUE/' + config_name
elif operating_system == 'Win64' or operating_system == 'Windows':
path_to_config = '%s/komodo/ROGUE/ROGUE.conf' % os.environ['APPDATA']
path_to_config = '%s/komodo/ROGUE/' + config_name % os.environ['APPDATA']
try:
copy(path_to_config, os.getcwd())
except Exception as e:
Expand Down
2 changes: 1 addition & 1 deletion rogue_tui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
tuilib.check_if_config_is_here(rpc_connection, "ROGUE.conf")
except Exception:
print(tuilib.colorize("Cant connect to ROGUE daemon RPC! Please check if daemon is up.", "pink"))
tuilib.exit()
Expand Down
2 changes: 1 addition & 1 deletion tetris_tui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
tuilib.check_if_config_is_here(rpc_connection, "GTEST.conf")
except Exception:
print(tuilib.colorize("Cant connect to GTEST daemon RPC! Please check if daemon is up.", "pink"))
tuilib.exit()
Expand Down

0 comments on commit 9edfd93

Please sign in to comment.