electrumsv / headless-sdk

Produce bundled portable python distributions ready for executing all SDK components in a fully self-contained way
2 stars 2 forks source link

SDK script name appears as `__main__.py` not `electrumsv-sdk.bat` #5

Closed rt121212121 closed 2 years ago

rt121212121 commented 2 years ago

SDK script name appears as __main__.py not electrumsv-sdk.bat

  1. Download and extract the Windows version of the headless SDK (0.0.40).
  2. Run the bat script electrumsv-sdk.bat.
  3. Observe __main__.py is there.
C:\Users\R\Downloads\headless-sdk-0.0.40-win32-x86_64>electrumsv-sdk.bat --help
usage: __main__.py [-h] [--version] {help,start,stop,reset,node,status,cli_inputs} ...
AustEcon commented 2 years ago

If I renamed __main__.py to electrumsv_sdk.py it will show as:

usage: electrumsv_sdk.py [-h] [--version] {help,start,stop,reset,node,status,cli_inputs} ...

Good enough? I don't think it's worth the effort to take this further than that.

I initially was using py2exe to make it a 9MB sized .exe instead of .py file as the entrypoint but at the time you told me to delete that code and use .bat instead...

rt121212121 commented 2 years ago

You should be able to look into sys.argv[0] I think.

AustEcon commented 2 years ago

I think I've figured out how to fix this. There's an ArgumentParser.prog attribute that can be overwritten and that's what determines the usage: <prog name> ... ...

Fix incoming..

AustEcon commented 2 years ago

It worked. The fix will be included in the next release.