Skip to content

Commit 7cc8680

Browse files
committed
Addressing PR review
1 parent 4f5031f commit 7cc8680

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

.github/workflows/docker-publish.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@ jobs:
3838
- name: Set up Docker Buildx
3939
uses: docker/setup-buildx-action@v2
4040

41-
# Login against a Docker registry except on PR
41+
# Login against a Docker registry
4242
# https://github.com/docker/login-action
4343
- name: Log into registry ${{ env.REGISTRY }}
44-
if: github.event_name != 'pull_request'
4544
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
4645
with:
4746
registry: ${{ env.REGISTRY }}

src/wei/core/admin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55

66

77
def send_safety_stop(module: Module) -> None:
8-
"""E-stops a module"""
8+
"""Safety stops a module"""
99
if AdminCommands.SAFETY_STOP in module.about.admin_commands:
1010
InterfaceMap.interfaces[module.interface].send_admin_command(
1111
module, AdminCommands.SAFETY_STOP
1212
)
13-
print(f"Module {module.name} has been e-stopped.")
13+
print(f"Module {module.name} has been safety-stopped.")
1414
else:
15-
print(f"Module {module.name} does not support e-stop.")
15+
print(f"Module {module.name} does not support safety stop.")
1616
send_pause(module)
1717

1818

src/wei/modules/rest_module.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class RESTModule:
6565

6666
# * Admin command function placeholders
6767
_safety_stop = None
68-
"""Handles custom e-stop functionality"""
68+
"""Handles custom safety-stop functionality"""
6969
_pause = None
7070
"""Handles custom pause functionality"""
7171
_reset = None
@@ -502,7 +502,7 @@ async def safety_stop(request: Request):
502502
if self._safety_stop:
503503
return self._safety_stop(state)
504504
else:
505-
return {"message": "Module e-stopped"}
505+
return {"message": "Module safety-stopped"}
506506

507507
@self.router.post("/admin/pause")
508508
async def pause(request: Request):
@@ -707,8 +707,8 @@ def example_shutdown_handler(state: State):
707707

708708
@rest_module.safety_stop()
709709
def custom_safety_stop(state: State):
710-
"""Custom e-stop functionality"""
711-
print("Custom e-stop functionality")
712-
return {"message": "Custom e-stop functionality"}
710+
"""Custom safety-stop functionality"""
711+
print("Custom safety-stop functionality")
712+
return {"message": "Custom safety-stop functionality"}
713713

714714
rest_module.start()

src/wei/routers/admin_routes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525

2626
@router.api_route("/safety_stop", methods=["POST"])
2727
def safety_stop_workcell() -> None:
28-
"""E-stops a workcell"""
28+
"""Safety-stops a workcell"""
2929
for module in state_manager.get_all_modules().values():
3030
send_safety_stop(module)
3131
state_manager.paused = True
3232

3333

3434
@router.api_route("/safety_stop/{module_name}", methods=["POST"])
3535
def safety_stop_module(module_name: str) -> None:
36-
"""E-stops a module"""
36+
"""Safety-stops a module"""
3737
send_safety_stop(state_manager.get_module(module_name))
3838

3939

src/wei/types/module_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Location(Generic[T]):
2727
class AdminCommands(str, Enum):
2828
"""Valid Admin Commands to send to a Module"""
2929

30-
ESTOP = "estop"
30+
SAFETY_STOP = "estop"
3131
RESET = "reset"
3232
PAUSE = "pause"
3333
RESUME = "resume"

tests/test_module/test_rest_node.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,5 @@ def measure_action(state: State, action: ActionRequest) -> StepResponse:
8686
return StepFileResponse(StepStatus.SUCCEEDED, "test", "test.txt")
8787

8888

89-
test_rest_node.start()
89+
if __name__ == "__main__":
90+
test_rest_node.start()

0 commit comments

Comments
 (0)