This repository was archived by the owner on May 13, 2022. It is now read-only.
Allow execution from any filepath #670
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Until now you had to go go into the folder containing wallet-tool, yg or any other of the tools to use them. This commit solves this (at least for wallet-tool, log creation and everywhere the Wallet class is used).
You can now execute joinmarket from any filepath using a command like this
python ~/Desktop/JoinmarketDev/yield-generator-basic.py wallet.jsonI am not sure if I have missed any code where the folder is being assumed.
To figure you the filepath a python function has been used. For all files in the /joinmarket/ subfolder the subfolder name is being stripped using
[:-11]. Additionally the method to get the filepath returns a tuple and the actual filepath is accessed using the index.I am not sure if this is best practice, since my knowledge in Python is still limited. Please suggest missing cases and code improvements!