I tried out your patch and i think there is one issue which is easy to fix in the legacy Click case:
@cli.resultcallback()
Should become:
@cli.result_callback()
Otherwise this got the base command to run but any of the sub commands all fail with:
File "/usr/bin/pio", line 33, in <module>
sys.exit(load_entry_point('platformio==4.3.4', 'console_scripts', 'pio')()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/platformio/__main__.py", line 129, in main
maintenance.on_platformio_exception(e)
File "/usr/lib/python3/dist-packages/platformio/maintenance.py", line 65, in on_platformio_exception
telemetry.on_exception(e)
File "/usr/lib/python3/dist-packages/platformio/telemetry.py", line 309, in on_exception
send_exception(description, is_fatal)
File "/usr/lib/python3/dist-packages/platformio/telemetry.py", line 381, in send_exception
mp = MeasurementProtocol() ^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/platformio/telemetry.py", line 77, in __init__
self["sr"] = "%dx%d" % click.get_terminal_size() ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'click' has no attribute 'get_terminal_size'
I tried out your patch and i think there is one issue which is easy to fix in the legacy Click case:
@cli. resultcallback( )
Should become:
@cli. result_ callback( )
Otherwise this got the base command to run but any of the sub commands all fail with:
File "/usr/bin/pio", line 33, in <module> exit(load_ entry_point( 'platformio= =4.3.4' , 'console_scripts', 'pio')())
^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^ python3/ dist-packages/ platformio/ __main_ _.py", line 129, in main .on_platformio_ exception( e) python3/ dist-packages/ platformio/ maintenance. py", line 65, in on_platformio_ exception on_exception( e) python3/ dist-packages/ platformio/ telemetry. py", line 309, in on_exception exception( description, is_fatal) python3/ dist-packages/ platformio/ telemetry. py", line 381, in send_exception ocol()
^^^^^ ^^^^^^^ ^^^^^^^ ^^ python3/ dist-packages/ platformio/ telemetry. py", line 77, in __init__ terminal_ size()
^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^
sys.
File "/usr/lib/
maintenance
File "/usr/lib/
telemetry.
File "/usr/lib/
send_
File "/usr/lib/
mp = MeasurementProt
File "/usr/lib/
self["sr"] = "%dx%d" % click.get_
AttributeError: module 'click' has no attribute 'get_terminal_size'