-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1526698
commit 3cacf3d
Showing
4 changed files
with
106 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
APP=pythonIndiExample | ||
PYTHON_SCRIPTS_PREFIX=$(shell python -c "import sysconfig; print(sysconfig.get_path('scripts'))") | ||
|
||
all : install | ||
|
||
.PHONY: all install | ||
|
||
install: | ||
sudo python -c 'import purepyindi2' || (echo "Need purepyindi2 installed to $(shell which python)" && exit 1) | ||
sudo python -c 'import xconf' || (echo "Need xconf installed to $(shell which python)" && exit 1) | ||
sudo python -m pip install -e . | ||
sudo ln -sfv $(PYTHON_SCRIPTS_PREFIX)/$(APP) /opt/MagAOX/bin/$(APP) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "pythonIndiExample" | ||
description = "Python INDI device implementation example" | ||
version = "2023.12.21" | ||
|
||
authors = [ | ||
{name = "Joseph D. Long", email = "[email protected]"}, | ||
] | ||
|
||
[project.scripts] | ||
pythonIndiExample = "pythonIndiExample:PythonIndiExample.console_app" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import sys | ||
import logging | ||
import xconf | ||
from magaox.indi.device import XDevice, BaseConfig | ||
|
||
log = logging.getLogger(__name__) | ||
|
||
@xconf.config | ||
class ExampleConfig(BaseConfig): | ||
"""Example Python INDI device for MagAO-X | ||
""" | ||
configurable_doodad_1 : str = xconf.field(default="abc", help="Configurable doodad 1") | ||
|
||
class PythonIndiExample(XDevice): | ||
config : ExampleConfig | ||
|
||
def loop(self): | ||
log.info("Looping") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters