-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from canvas-medical/bg-plugin-reload
- Loading branch information
Showing
35 changed files
with
404 additions
and
32 deletions.
There are no files selected for viewing
File renamed without changes.
14 changes: 14 additions & 0 deletions
14
canvas_cli/templates/plugins/default/{{ cookiecutter.project_slug }}/pyproject.toml
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,14 @@ | ||
[tool.poetry] | ||
classifiers = ["Environment :: Canvas :: Plugins"] | ||
name = "{{ cookiecutter.project_name.lower().strip().replace(' ', '_') }}" | ||
version = "{{ cookiecutter.version }}" | ||
description = "" | ||
authors = ["Beau Gunderson <beau@beaugunderson.com>"] | ||
readme = "README.md" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.11" | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
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,27 @@ | ||
{ | ||
"sdk_version": "0.1.4", | ||
"plugin_version": "0.1.0", | ||
"name": "My First Plugin", | ||
"description": "A plugin to interact with a Canvas Instance", | ||
"components": { | ||
"protocols": [ | ||
{ | ||
"class": "my_first_plugin.protocols.protocol:Protocol", | ||
"description": "A protocol that does xyz...", | ||
"data_access": { | ||
"event": "assess_condition_selected", | ||
"read": [ | ||
"conditions" | ||
], | ||
"write": [ | ||
"commands" | ||
] | ||
} | ||
} | ||
], | ||
"commands": [], | ||
"content": [], | ||
"effects": [], | ||
"views": [] | ||
} | ||
} |
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 @@ | ||
=============== | ||
My First Plugin | ||
=============== | ||
|
||
A plugin to interact with a Canvas Instance | ||
|
||
## Structure | ||
|
||
``` | ||
my_first_plugin/ | ||
├── commands/ | ||
├── content/ | ||
├── effects/ | ||
├── protocols/ | ||
├── views/ | ||
├── CANVAS_MANIFEST.json | ||
└── README.md | ||
``` |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
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,22 @@ | ||
import json | ||
|
||
|
||
class Protocol: | ||
RESPONDS_TO = "ASSESS_COMMAND__CONDITION_SELECTED" | ||
|
||
NARRATIVE_STRING = "monkey" | ||
|
||
def __init__(self, event) -> None: | ||
self.event = event | ||
self.payload = json.loads(event.target) | ||
|
||
def compute(self): | ||
return [ | ||
{ | ||
"effect_type": "ADD_PLAN_COMMAND", | ||
"payload": { | ||
"note": {"uuid": self.payload["note"]["uuid"]}, | ||
"data": {"narrative": self.NARRATIVE_STRING}, | ||
}, | ||
} | ||
] |
Empty file.
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,27 @@ | ||
{ | ||
"sdk_version": "0.1.4", | ||
"plugin_version": "0.1.0", | ||
"name": "My Second Plugin", | ||
"description": "A plugin to interact with a Canvas Instance", | ||
"components": { | ||
"protocols": [ | ||
{ | ||
"class": "my_second_plugin.protocols.protocol:Protocol", | ||
"description": "A protocol that does xyz...", | ||
"data_access": { | ||
"event": "assess_condition_selected", | ||
"read": [ | ||
"conditions" | ||
], | ||
"write": [ | ||
"commands" | ||
] | ||
} | ||
} | ||
], | ||
"commands": [], | ||
"content": [], | ||
"effects": [], | ||
"views": [] | ||
} | ||
} |
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 @@ | ||
================ | ||
My Second Plugin | ||
================ | ||
|
||
A plugin to interact with a Canvas Instance | ||
|
||
## Structure | ||
|
||
``` | ||
my_second_plugin/ | ||
├── commands/ | ||
├── content/ | ||
├── effects/ | ||
├── protocols/ | ||
├── views/ | ||
├── CANVAS_MANIFEST.json | ||
└── README.md | ||
``` |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
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,14 @@ | ||
import json | ||
|
||
|
||
class Protocol: | ||
RESPONDS_TO = "SOMETHING_ELSE" | ||
|
||
NARRATIVE_STRING = "" | ||
|
||
def __init__(self, event) -> None: | ||
self.event = event | ||
self.payload = json.loads(event.target) | ||
|
||
def compute(self): | ||
return [{"effect_type": "ANOTHER_COMMAND_ADDITION", "payload": {}}] |
Empty file.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 @@ | ||
from google.protobuf import descriptor as _descriptor | ||
from google.protobuf import message as _message | ||
from typing import ClassVar as _ClassVar, Optional as _Optional | ||
|
||
DESCRIPTOR: _descriptor.FileDescriptor | ||
|
||
class ReloadPluginsRequest(_message.Message): | ||
__slots__ = () | ||
def __init__(self) -> None: ... | ||
|
||
class ReloadPluginsResponse(_message.Message): | ||
__slots__ = ("success",) | ||
SUCCESS_FIELD_NUMBER: _ClassVar[int] | ||
success: bool | ||
def __init__(self, success: bool = ...) -> None: ... |
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,4 @@ | ||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! | ||
"""Client and server classes corresponding to protobuf-defined services.""" | ||
import grpc | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Oops, something went wrong.