Skip to content

Commit cba1846

Browse files
committed
refactor file and class names
1 parent e10ce5a commit cba1846

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
logger = getLogger(__name__)
1010

1111

12-
class MicroPythonSerialBase:
12+
class SerialBase:
1313
"""
1414
Manages a MicroPython serial connection.
1515
"""
@@ -53,7 +53,7 @@ def _disconnect(self) -> None:
5353
if self._ser and self._ser.is_open:
5454
self._ser.close()
5555

56-
def __enter__(self) -> "MicroPythonSerialBase":
56+
def __enter__(self) -> "SerialBase":
5757
"""
5858
Provides context management for the MicroPythonTree, ensuring resources are
5959
properly opened and can be safely used within the context.

serial_plugin/serial_command_runner.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from logging import getLogger, debug
22
from threading import Thread
33
from typing import Callable
4-
from serial_plugin.serial_get_micropython_version import MicroPythonVersion
5-
from serial_plugin.serial_get_file_structure import MicroPythonFileStructure
4+
from serial_plugin.serial_get_version import Version
5+
from serial_plugin.serial_get_file_structure import FileStructure
66

77

88
logger = getLogger(__name__)
@@ -44,7 +44,7 @@ def _get_version(port: str) -> str:
4444
:return: The version of MicroPython as a string.
4545
:rtype: str
4646
"""
47-
with MicroPythonVersion(port=port) as version_fetcher:
47+
with Version(port=port) as version_fetcher:
4848
return version_fetcher.get_version()
4949

5050
@staticmethod
@@ -57,7 +57,7 @@ def _get_structure(port: str) -> str:
5757
:return: The file structure as a string.
5858
:rtype: str
5959
"""
60-
with MicroPythonFileStructure(port=port) as structure_fetcher:
60+
with FileStructure(port=port) as structure_fetcher:
6161
return structure_fetcher.get_tree()
6262

6363
def get_version(self, port: str, callback: Callable[[str], None]) -> None:

serial_plugin/serial_get_file_structure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
from logging import getLogger, debug
22
from time import time, sleep
3-
from serial_plugin.base_serial import MicroPythonSerialBase
3+
from serial_plugin.serial_base import SerialBase
44

55

66
logger = getLogger(__name__)
77

88

9-
class MicroPythonFileStructure(MicroPythonSerialBase):
9+
class FileStructure(SerialBase):
1010
"""
1111
Represents a utility for interacting with a MicroPython device to fetch and manage
1212
a tree structure of the file system over a serial connection.

serial_plugin/serial_get_micropython_version.py renamed to serial_plugin/serial_get_version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
from logging import getLogger, debug
22
from time import sleep
3-
from serial_plugin.base_serial import MicroPythonSerialBase
3+
from serial_plugin.serial_base import SerialBase
44

55

66
logger = getLogger(__name__)
77

88

9-
class MicroPythonVersion(MicroPythonSerialBase):
9+
class Version(SerialBase):
1010
"""
1111
Represents a utility for interacting with a MicroPython device to fetch the
1212
current Micropython version information over a serial connection.

0 commit comments

Comments
 (0)