Skip to content

Commit 86e6f48

Browse files
committed
更名MicroPython为QuecPython
1 parent 1225ee6 commit 86e6f48

File tree

15 files changed

+60
-59
lines changed

15 files changed

+60
-59
lines changed

thonnycontrib/quecpython/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from thonny import get_workbench
22
from thonny.plugins.quecpython.backend.mp_front import (
33
add_quecpython_backend,
4-
GenericBareMetalMicroPythonConfigPage,
5-
GenericBareMetalMicroPythonProxy
4+
GenericBareMetalQuecPythonConfigPage,
5+
GenericBareMetalQuecPythonProxy
66
)
77

88

@@ -21,9 +21,9 @@ def create_view():
2121
def load_plugin():
2222
add_quecpython_backend(
2323
"GenericQuecPython",
24-
GenericBareMetalMicroPythonProxy,
24+
GenericBareMetalQuecPythonProxy,
2525
"QuecPython (generic)",
26-
GenericBareMetalMicroPythonConfigPage,
26+
GenericBareMetalQuecPythonConfigPage,
2727
sort_key="51",
2828
)
2929
create_view()
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11

22
from thonny.plugins.quecpython.backend.mp_front import (
3-
BareMetalMicroPythonConfigPage,
4-
BareMetalMicroPythonProxy,
5-
GenericBareMetalMicroPythonConfigPage,
6-
GenericBareMetalMicroPythonProxy,
7-
LocalMicroPythonConfigPage,
8-
LocalMicroPythonProxy,
9-
MicroPythonProxy,
10-
SshMicroPythonConfigPage,
11-
SshMicroPythonProxy,
3+
BareMetalQuecPythonConfigPage,
4+
BareMetalQuecPythonProxy,
5+
GenericBareMetalQuecPythonConfigPage,
6+
GenericBareMetalQuecPythonProxy,
7+
LocalQuecPythonConfigPage,
8+
LocalQuecPythonProxy,
9+
QuecPythonProxy,
10+
SshQuecPythonConfigPage,
11+
SshQuecPythonProxy,
1212
add_quecpython_backend,
1313
list_serial_ports,
1414
)

thonnycontrib/quecpython/backend/bare_metal_backend.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
serialize_message,
2727
)
2828
from thonny.misc_utils import find_volumes_by_name
29-
from thonny.plugins.quecpython.backend.connection import MicroPythonConnection
29+
from thonny.plugins.quecpython.backend.connection import QuecPythonConnection
3030
from thonny.plugins.quecpython.backend.mp_back import (
3131
EOT,
3232
NORMAL_MODE_CMD,
@@ -37,7 +37,7 @@
3737
WAIT_OR_CRASH_TIMEOUT,
3838
Y2000_EPOCH_OFFSET,
3939
ManagementError,
40-
MicroPythonBackend,
40+
QuecPythonBackend,
4141
ProtocolError,
4242
ReadOnlyFilesystemError,
4343
ends_overlap,
@@ -125,7 +125,7 @@
125125
logger = getLogger("thonny.plugins.quecpython.backend.bare_metal_backend")
126126

127127

128-
class BareMetalMicroPythonBackend(MicroPythonBackend, UploadDownloadMixin):
128+
class BareMetalQuecPythonBackend(QuecPythonBackend, UploadDownloadMixin):
129129
def __init__(self, connection, clean, args):
130130
self._connection = connection
131131
self._startup_time = time.time()
@@ -163,9 +163,9 @@ def __init__(self, connection, clean, args):
163163

164164
self._last_prompt = None
165165

166-
MicroPythonBackend.__init__(self, clean, args)
166+
QuecPythonBackend.__init__(self, clean, args)
167167

168-
def get_connection(self) -> MicroPythonConnection:
168+
def get_connection(self) -> QuecPythonConnection:
169169
return self._connection
170170

171171
def _check_prepare(self):
@@ -1709,7 +1709,7 @@ def _report_internal_exception(self, msg: str) -> None:
17091709
)
17101710

17111711

1712-
class GenericBareMetalMicroPythonBackend(BareMetalMicroPythonBackend):
1712+
class GenericBareMetalMicroPythonBackend(BareMetalQuecPythonBackend):
17131713
def _get_sys_path_for_analysis(self) -> Optional[List[str]]:
17141714
return [
17151715
os.path.join(os.path.dirname(__file__), "generic_api_stubs"),
@@ -1720,7 +1720,7 @@ class RawPasteNotSupportedError(RuntimeError):
17201720
pass
17211721

17221722

1723-
def launch_bare_metal_backend(backend_class: Callable[..., BareMetalMicroPythonBackend]) -> None:
1723+
def launch_bare_metal_backend(backend_class: Callable[..., BareMetalQuecPythonBackend]) -> None:
17241724
thonny.configure_backend_logging()
17251725
print(PROCESS_ACK)
17261726

thonnycontrib/quecpython/backend/base_api_stubs/checkNet.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ def waitNetworkReady(timeout: int = 60) -> tuple:
1717
2表示网络注册状态,范围0-11,每个状态值的详细说明,请参考net.getState()方法的返回值说明;
1818
3表示PDP Context激活状态,0表示没有激活成功,1表示激活成功。
1919
"""
20+
...

thonnycontrib/quecpython/backend/base_flashing_dialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ def is_ready_for_work(self):
401401
return self._target_combo.get_selected_value() and self._version_combo.get_selected_value()
402402

403403
def start_work(self):
404-
from thonny.plugins.quecpython.backend import BareMetalMicroPythonProxy
404+
from thonny.plugins.quecpython.backend import BareMetalQuecPythonProxy
405405

406406
variant_info: Dict[str, Any] = self._variant_combo.get_selected_value()
407407
download_info: Dict[str, Any] = self._version_combo.get_selected_value()

thonnycontrib/quecpython/backend/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
logger = getLogger(__name__)
99

1010

11-
class MicroPythonConnection:
11+
class QuecPythonConnection:
1212
"""Utility class for using Serial or WebSocket connection
1313
1414
Uses background thread to read from the source as soon as possible

thonnycontrib/quecpython/backend/esptool_dialog.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from thonny import get_runner, get_workbench, ui_utils
1313
from thonny.common import normpath_with_actual_case
1414
from thonny.misc_utils import get_menu_char, running_on_windows
15-
from thonny.plugins.quecpython.backend import BareMetalMicroPythonProxy, list_serial_ports
15+
from thonny.plugins.quecpython.backend import BareMetalQuecPythonProxy, list_serial_ports
1616
from thonny.plugins.quecpython.backend.base_flashing_dialog import (
1717
BaseFlashingDialog,
1818
TargetInfo,
@@ -232,7 +232,7 @@ def prepare_work_get_options(self) -> Dict[str, Any]:
232232
target = self._target_combo.get_selected_value()
233233
proxy = get_runner().get_backend_proxy()
234234
port_was_used_in_thonny = (
235-
isinstance(proxy, BareMetalMicroPythonProxy) and proxy._port == target.port.device
235+
isinstance(proxy, BareMetalQuecPythonProxy) and proxy._port == target.port.device
236236
)
237237
if port_was_used_in_thonny and self._work_needs_disconnect():
238238
logger.info("Disconnecting")

thonnycontrib/quecpython/backend/mp_back.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
parse_message,
7676
serialize_message,
7777
)
78-
from thonny.plugins.quecpython.backend.connection import MicroPythonConnection
78+
from thonny.plugins.quecpython.backend.connection import QuecPythonConnection
7979

8080
ENCODING = "utf-8"
8181

@@ -112,15 +112,15 @@
112112
logger = getLogger(__name__)
113113

114114

115-
class MicroPythonBackend(MainBackend, ABC):
115+
class QuecPythonBackend(MainBackend, ABC):
116116
def __init__(self, clean, args):
117117
# Make pipkin available
118118
sys.path.insert(
119119
0,
120120
os.path.normpath(os.path.join(os.path.dirname(__file__), "..", "..", "vendored_libs")),
121121
)
122-
logger.info("Initializing MicroPythonBackend of type %s", type(self).__name__)
123-
self._connection: MicroPythonConnection
122+
logger.info("Initializing QuecPythonBackend of type %s", type(self).__name__)
123+
self._connection: QuecPythonConnection
124124
self._args = args
125125
self._last_interrupt_time = None
126126
self._local_cwd = None
@@ -160,7 +160,7 @@ def __init__(self, clean, args):
160160
except ConnectionError as e:
161161
self.handle_connection_error(e)
162162
except Exception:
163-
logger.exception("Exception in MicroPython main method")
163+
logger.exception("Exception in QuecPython main method")
164164
self._report_internal_exception("Internal error")
165165

166166
def _prepare_after_soft_reboot(self, clean=False):
@@ -277,7 +277,7 @@ def listdir(cls, x):
277277
+ "\n"
278278
).lstrip()
279279

280-
def get_connection(self) -> MicroPythonConnection:
280+
def get_connection(self) -> QuecPythonConnection:
281281
raise NotImplementedError()
282282

283283
def _sync_time(self):

thonnycontrib/quecpython/backend/mp_front.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
VIDS_PIDS_TO_AVOID_IN_GENERIC_BACKEND = set()
2727

2828

29-
class MicroPythonProxy(SubprocessProxy):
29+
class QuecPythonProxy(SubprocessProxy):
3030
def __init__(self, clean):
3131
self._lib_dirs = []
3232
super().__init__(clean, running.get_front_interpreter_for_subprocess())
@@ -53,7 +53,7 @@ def get_lib_dirs(self):
5353
return self._lib_dirs
5454

5555
def _store_state_info(self, msg):
56-
super(MicroPythonProxy, self)._store_state_info(msg)
56+
super(QuecPythonProxy, self)._store_state_info(msg)
5757
if "lib_dirs" in msg:
5858
self._lib_dirs = msg["lib_dirs"]
5959

@@ -84,7 +84,7 @@ def is_valid_configuration(cls, conf: Dict[str, Any]) -> bool:
8484
return True
8585

8686

87-
class BareMetalMicroPythonProxy(MicroPythonProxy):
87+
class BareMetalQuecPythonProxy(QuecPythonProxy):
8888
def __init__(self, clean):
8989
self._port = get_workbench().get_option(self.backend_name + ".port")
9090
self._clean_start = clean
@@ -96,9 +96,9 @@ def get_target_executable(self) -> Optional[str]:
9696
return None
9797

9898
def get_pip_gui_class(self):
99-
from thonny.plugins.quecpython.backend.pip_gui import MicroPythonPipDialog
99+
from thonny.plugins.quecpython.backend.pip_gui import QuecPythonPipDialog
100100

101-
return MicroPythonPipDialog
101+
return QuecPythonPipDialog
102102

103103
def destroy(self, for_restart: bool = False):
104104
super().destroy(for_restart=for_restart)
@@ -418,7 +418,7 @@ def run_script_in_terminal(self, script_path, args, interactive, keep_open):
418418
)
419419

420420

421-
class BareMetalMicroPythonConfigPage(BackendDetailsConfigPage):
421+
class BareMetalQuecPythonConfigPage(BackendDetailsConfigPage):
422422
backend_name = None # Will be overwritten on Workbench.add_backend
423423

424424
def __init__(self, master):
@@ -664,7 +664,7 @@ def allow_webrepl(self):
664664
return False
665665

666666

667-
class GenericBareMetalMicroPythonProxy(BareMetalMicroPythonProxy):
667+
class GenericBareMetalQuecPythonProxy(BareMetalQuecPythonProxy):
668668
@classmethod
669669
def get_known_usb_vids_pids(cls):
670670
"""Return set of pairs of USB device (VID, PID)"""
@@ -680,13 +680,13 @@ def get_vids_pids_to_avoid(self):
680680
return VIDS_PIDS_TO_AVOID_IN_GENERIC_BACKEND
681681

682682

683-
class GenericBareMetalMicroPythonConfigPage(BareMetalMicroPythonConfigPage):
683+
class GenericBareMetalQuecPythonConfigPage(BareMetalQuecPythonConfigPage):
684684
@property
685685
def allow_webrepl(self):
686686
return False
687687

688688

689-
class LocalMicroPythonProxy(MicroPythonProxy):
689+
class LocalQuecPythonProxy(QuecPythonProxy):
690690
def __init__(self, clean):
691691
exe = get_workbench().get_option("LocalMicroPython.executable")
692692
if os.path.isabs(exe):
@@ -799,7 +799,7 @@ def is_valid_configuration(cls, conf: Dict[str, Any]) -> bool:
799799
return os.path.exists(executable) or shutil.which(executable)
800800

801801

802-
class LocalMicroPythonConfigPage(BackendDetailsConfigPage):
802+
class LocalQuecPythonConfigPage(BackendDetailsConfigPage):
803803
backend_name = None # Will be overwritten on Workbench.add_backend
804804

805805
def __init__(self, master):
@@ -820,7 +820,7 @@ def should_restart(self):
820820
return self._changed
821821

822822

823-
class SshMicroPythonProxy(MicroPythonProxy):
823+
class SshQuecPythonProxy(QuecPythonProxy):
824824
def __init__(self, clean):
825825
self._host = get_workbench().get_option(f"{self.backend_name}.host")
826826
self._user = get_workbench().get_option(f"{self.backend_name}.user")
@@ -959,7 +959,7 @@ def is_valid_configuration(cls, conf: Dict[str, Any]) -> bool:
959959
return True
960960

961961

962-
class SshMicroPythonConfigPage(BaseSshProxyConfigPage):
962+
class SshQuecPythonConfigPage(BaseSshProxyConfigPage):
963963
pass
964964

965965

thonnycontrib/quecpython/backend/os_mp_backend.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
from thonny.backend import SshMixin
2121
from thonny.common import PROCESS_ACK, BackendEvent, serialize_message
2222
from thonny.plugins.quecpython.backend.bare_metal_backend import LF, NORMAL_PROMPT
23-
from thonny.plugins.quecpython.backend.connection import MicroPythonConnection
23+
from thonny.plugins.quecpython.backend.connection import QuecPythonConnection
2424
from thonny.plugins.quecpython.backend.mp_back import (
2525
ENCODING,
2626
EOT,
2727
PASTE_MODE_CMD,
2828
PASTE_MODE_LINE_PREFIX,
2929
ManagementError,
30-
MicroPythonBackend,
30+
QuecPythonBackend,
3131
ends_overlap,
3232
)
3333
from thonny.plugins.quecpython.backend.mp_common import PASTE_SUBMIT_MODE
@@ -65,7 +65,7 @@
6565
]
6666

6767

68-
class UnixMicroPythonBackend(MicroPythonBackend, ABC):
68+
class UnixQuecPythonBackend(QuecPythonBackend, ABC):
6969
def __init__(self, args):
7070
try:
7171
self._interpreter = self._resolve_executable(args["interpreter"])
@@ -77,9 +77,9 @@ def __init__(self, args):
7777
sys.stdout.flush()
7878
sys.exit(1)
7979

80-
MicroPythonBackend.__init__(self, None, args)
80+
QuecPythonBackend.__init__(self, None, args)
8181

82-
def get_connection(self) -> MicroPythonConnection:
82+
def get_connection(self) -> QuecPythonConnection:
8383
return self._connection
8484

8585
def _resolve_executable(self, executable):
@@ -315,7 +315,7 @@ def _extract_block_without_splitting_chars(self, source_bytes: bytes) -> bytes:
315315
return source_bytes
316316

317317

318-
class LocalUnixMicroPythonBackend(UnixMicroPythonBackend):
318+
class LocalUnixMicroPythonBackend(UnixQuecPythonBackend):
319319
def _create_connection(self, run_args=[]):
320320
from thonny.plugins.quecpython.backend.subprocess_connection import SubprocessConnection
321321

0 commit comments

Comments
 (0)