Skip to content

Commit

Permalink
fix path to configs
Browse files Browse the repository at this point in the history
  • Loading branch information
tonymorony committed Mar 27, 2019
1 parent 9edfd93 commit d14cae2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions lib/tuilib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
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, "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()
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, "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()
Expand Down

0 comments on commit d14cae2

Please sign in to comment.