Skip to content

Commit 7821f9c

Browse files
committed
Base classes for running
1 parent 3120b88 commit 7821f9c

File tree

7 files changed

+38
-4
lines changed

7 files changed

+38
-4
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
# production
1212
/build
1313

14+
# python stuff
15+
__pycache__
16+
*.egg-info
17+
1418
# misc
1519
.DS_Store
1620
.env.local
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"""Base classes for SystemCore blocks interface."""
2+
3+
from .opmode import OpMode, Teleop
4+
from .mechanism import Mechanism
5+
from .robot_base import RobotBase
6+
7+
__all__ = ['OpMode', 'Teleop', 'Mechanism', 'RobotBase']
File renamed without changes.

server_python_scripts/base_classes/opmode.py renamed to server_python_scripts/blocks_base_classes/opmode.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,8 @@ def start(self):
77
def loop(self):
88
self.robot.update()
99
def stop(self):
10-
self.robot.stop()
10+
self.robot.stop()
11+
12+
# For now this does nothing but it lets the decorator work
13+
def Teleop(OpMode):
14+
return OpMode
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "blocks_base_classes"
7+
version = "0.1.0"
8+
description = "Base classes for SystemCore blocks interface"
9+
requires-python = ">=3.8"
10+
license = {text = "Apache-2.0"}
11+
authors = [
12+
{name = "Alan Smith", email = "[email protected]"}
13+
]
14+
dependencies = []
15+
16+
[tool.setuptools.packages.find]
17+
where = ["."]
18+
include = ["blocks_base_classes*"]
19+
20+
[tool.setuptools.package-dir]
21+
"blocks_base_classes" = "."
File renamed without changes.

server_python_scripts/run_opmode.py

100644100755
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@
1515
import argparse
1616
from pathlib import Path
1717

18-
# Add the current directory to Python path to import local modules
19-
sys.path.insert(0, str(Path(__file__).parent))
18+
from blocks_base_classes import OpMode
2019

21-
from opmode import OpMode
2220
from robot import Robot
2321

2422

0 commit comments

Comments
 (0)