From e4f688765a4080a1ca981be3b2e7e158e99adfcc Mon Sep 17 00:00:00 2001 From: Axel Gembe Date: Sun, 18 Oct 2020 09:26:30 +0700 Subject: [PATCH] Some more package rename changes Updated `MANIFEST.in` to include the new package name. Fixed some comments referring to the old package names. Removed `package_dir` from `setup.py`, it is not necessary anymore. --- MANIFEST.in | 7 +++---- .../src/main/java/org/electroncash/electroncash3/Util.kt | 2 +- android/app/src/main/res/values/donottranslate.xml | 2 +- electroncash/paymentrequest.py | 2 +- electroncash/secp256k1.py | 2 +- electroncash/transaction.py | 2 +- electroncash/util.py | 2 +- electroncash_plugins/fusion/covert.py | 2 +- setup.py | 5 ----- 9 files changed, 10 insertions(+), 16 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index cb2eff1a30c6..9b1c3f2162d1 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -6,12 +6,11 @@ include *.py include electron-cash include contrib/requirements/requirements.txt include contrib/requirements/requirements-hw.txt -recursive-include lib *.py -recursive-include gui *.py -recursive-include plugins *.py +recursive-include electroncash *.py +recursive-include electroncash_gui *.py +recursive-include electroncash_plugins *.py recursive-include packages *.py recursive-include packages cacert.pem include icons.qrc recursive-include icons * recursive-include scripts * - diff --git a/android/app/src/main/java/org/electroncash/electroncash3/Util.kt b/android/app/src/main/java/org/electroncash/electroncash3/Util.kt index 660a4b44ba6e..e56138e11e52 100644 --- a/android/app/src/main/java/org/electroncash/electroncash3/Util.kt +++ b/android/app/src/main/java/org/electroncash/electroncash3/Util.kt @@ -43,7 +43,7 @@ fun toSatoshis(s: String, places: Int = unitPlaces) : Long { } } -// We use Locale.US to be consistent with lib/exchange_rate.py, which is also locale-insensitive. +// We use Locale.US to be consistent with electroncash/exchange_rate.py, which is also locale-insensitive. @JvmOverloads // For data binding call in address_list.xml. fun formatSatoshis(amount: Long, places: Int = unitPlaces): String { val unit = Math.pow(10.0, places.toDouble()) diff --git a/android/app/src/main/res/values/donottranslate.xml b/android/app/src/main/res/values/donottranslate.xml index 48ca7ded5a51..d1769d99912d 100644 --- a/android/app/src/main/res/values/donottranslate.xml +++ b/android/app/src/main/res/values/donottranslate.xml @@ -23,7 +23,7 @@ m/44\'/145\'/0\' - + @string/pending @string/expired diff --git a/electroncash/paymentrequest.py b/electroncash/paymentrequest.py index 28f0af121b47..6ddc3c36d9a9 100644 --- a/electroncash/paymentrequest.py +++ b/electroncash/paymentrequest.py @@ -38,7 +38,7 @@ try: from . import paymentrequest_pb2 as pb2 except ImportError: - sys.exit("Error: could not find paymentrequest_pb2.py. Create it with 'protoc --proto_path=lib/ --python_out=lib/ lib/paymentrequest.proto'") + sys.exit("Error: could not find paymentrequest_pb2.py. Create it with 'protoc --proto_path=electroncash/ --python_out=electroncash/ electroncash/paymentrequest.proto'") from . import bitcoin from . import version diff --git a/electroncash/secp256k1.py b/electroncash/secp256k1.py index 3777fd304cd2..572604eb7fe5 100644 --- a/electroncash/secp256k1.py +++ b/electroncash/secp256k1.py @@ -36,7 +36,7 @@ def _load_library(): if sys.platform == 'darwin': library_paths = ('libsecp256k1.0.dylib', # on Mac it's in the pyinstaller top level folder, which is in libpath - os.path.join(os.path.dirname(__file__), 'libsecp256k1.0.dylib')) # fall back to "running from source" mode lib/ folder + os.path.join(os.path.dirname(__file__), 'libsecp256k1.0.dylib')) # fall back to "running from source" mode electroncash/ folder elif sys.platform in ('windows', 'win32'): library_paths = ('libsecp256k1-0.dll', # on Windows it's in the pyinstaller top level folder, which is in the path os.path.join(os.path.dirname(__file__), 'libsecp256k1-0.dll')) # does running from source even make sense on Windows? Enquiring minds want to know. diff --git a/electroncash/transaction.py b/electroncash/transaction.py index e4714c2dd050..676236139972 100644 --- a/electroncash/transaction.py +++ b/electroncash/transaction.py @@ -1350,7 +1350,7 @@ def tx_from_str(txt): # --- class OPReturn: ''' OPReturn helper namespace. Used by GUI main_window.py and also - lib/commands.py ''' + electroncash/commands.py ''' class Error(Exception): """ thrown when the OP_RETURN for a tx not of the right format """ diff --git a/electroncash/util.py b/electroncash/util.py index 5f44bfb51b2a..c6163bd31d3e 100644 --- a/electroncash/util.py +++ b/electroncash/util.py @@ -838,7 +838,7 @@ def run_with_except_hook(*args2, **kwargs2): def versiontuple(v): ''' Please do not use this function as it breaks with EC version styles - of things like '3.3.4CS'. Instead, use lib/version.parse_package_version''' + of things like '3.3.4CS'. Instead, use electroncash/version.parse_package_version''' return tuple(map(int, (v.split(".")))) diff --git a/electroncash_plugins/fusion/covert.py b/electroncash_plugins/fusion/covert.py index 155996666e05..d0aa8503b573 100644 --- a/electroncash_plugins/fusion/covert.py +++ b/electroncash_plugins/fusion/covert.py @@ -65,7 +65,7 @@ def is_tor_port(host, port): try: socketclass = socket.socket try: - # socket.socket could be monkeypatched (see lib/network.py), + # socket.socket could be monkeypatched (see electroncash/network.py), # in which case we need to get the real one. socketclass = socket._socketobject except AttributeError: diff --git a/setup.py b/setup.py index f79fb1ddb540..5564d95ea8c8 100755 --- a/setup.py +++ b/setup.py @@ -174,11 +174,6 @@ def run(self): 'electroncash_plugins.satochip', 'electroncash_plugins.fusion', ], - package_dir={ - 'electroncash': 'electroncash', - 'electroncash_gui': 'electroncash_gui', - 'electroncash_plugins': 'electroncash_plugins', - }, package_data={ 'electroncash': [ 'servers.json',