Skip to content
Snippets Groups Projects
Commit 0414dc9d authored by Florian Schröder's avatar Florian Schröder
Browse files

extending the aaambos create command for creating issues, observers, tiers,...

extending the aaambos create command for creating issues, observers, tiers, and xmits. Requires aaambos version >=0.1.15
parent ac462a57
No related branches found
No related tags found
No related merge requests found
Pipeline #43416 passed
......@@ -27,6 +27,16 @@ setup(
'Programming Language :: Python :: 3.10',
],
description="A dialog manager for aaambos based on the ideas from flexdiam (a flexible dialog manager) but in its current state a reduced and simplified version",
entry_points={
'aaambos.core.create': [
'issue = simple_flexdiam.plugins.create:issue',
'observer = simple_flexdiam.plugins.create:observer',
'tier = simple_flexdiam.plugins.create:tier',
'xmit = simple_flexdiam.plugins.create:xmit',
#'entry_point_finder = simple_flexdiam.plugins.create:entry_point_finder',
#'flow_handler = simple_flexdiam.plugins.create:flow_handler',
],
},
install_requires=requirements,
license="MIT license",
long_description=readme + '\n\n' + history,
......@@ -37,6 +47,6 @@ setup(
test_suite='tests',
tests_require=test_requirements,
url='https://gitlab.ub.uni-bielefeld.de/scs/aaambos/aaambos_pkg_simple_flexdiam',
version='0.1.3',
version='0.1.4',
zip_safe=False,
)
\ No newline at end of file
"""
Simple Flexdiam extends the [`create`-command](https://scs.pages.ub.uni-bielefeld.de/aaambos/aaambos/aaambos/core/commands/create.html#Create) in _aaambos_.
## Issues
The bash command
```bash
aaambos create issue -n MyNewIssue
```
creates a new python file `my_new_issue.py` containing a `MyNewIssue` class based on the ExampleIssue in the aaambos pkg cookiecutter template in the `flexdiam_pkg` branch.
All names are replaced accordingly.
## Observers
The bash command
```bash
aaambos create observer -n MyNewObserver
```
creates a new python file `my_new_observer.py` containing a `MyNewObserver` class based on the ExmpleObserver in the aaambos pkg cookiecutter template in the `flexdiam_pkg` branch.
All names are replaced accordingly.
## Tiers
The bash command
```bash
aaambos create tier -n MyNewTier
```
creates a new python file `my_new_tier.py` containing a `MyNewTier` class based on the ExampleTier in the aaambos pkg cookiecutter template in the `flexdiam_pkg` branch.
All names are replaced accordingly.
## XMits
The bash command
```bash
aaambos create xmit -n MyNewXMit
```
creates a new python file `my_new_x_mit.py` containing a `MyNewXMit` class based on the ExampleXMit in the aaambos pkg cookiecutter template in the `flexdiam_pkg` branch.
All names are replaced accordingly.
"""
\ No newline at end of file
from loguru import logger
from aaambos.core.commands.create import Create, create_file_from_url
def issue(create: Create):
"""Entry point for creating an issue with the aaambos `create` command."""
create_file_from_url(
url="https://gitlab.ub.uni-bielefeld.de/api/v4/projects/6430/repository/files/{{cookiecutter.repo_name}}%2f{{cookiecutter.__package_name}}%2fissues%2fexample_issue.py/raw?ref=flexdiam_pkg",
snake_case="example_issue",
camel_case="ExampleIssue",
kind="issue",
create=create,
)
def observer(create: Create):
"""Entry point for creating an observer with the aaambos `create` command."""
create_file_from_url(
url="https://gitlab.ub.uni-bielefeld.de/api/v4/projects/6430/repository/files/{{cookiecutter.repo_name}}%2f{{cookiecutter.__package_name}}%2fobservers%2fexample_observer.py/raw?ref=flexdiam_pkg",
snake_case="example_observer",
camel_case="Example_observer",
kind="observer",
create=create,
)
def tier(create: Create):
"""Entry point for creating a tier with the aaambos `create` command."""
create_file_from_url(
url="https://gitlab.ub.uni-bielefeld.de/api/v4/projects/6430/repository/files/{{cookiecutter.repo_name}}%2f{{cookiecutter.__package_name}}%2ftiers%2fexample_tier.py/raw?ref=flexdiam_pkg",
snake_case="example_tier",
camel_case="ExampleTier",
kind="tier",
create=create,
)
def xmit(create: Create):
"""Entry point for creating an xmit with the aaambos `create` command."""
create_file_from_url(
url="https://gitlab.ub.uni-bielefeld.de/api/v4/projects/6430/repository/files/{{cookiecutter.repo_name}}%2f{{cookiecutter.__package_name}}%2fxmits%2fexample_xmit.py/raw?ref=flexdiam_pkg",
snake_case="example_xmit",
camel_case="ExampleXMit",
kind="xmit",
create=create,
)
def entry_point_finder(create: Create):
"""Future entry point to create an entry point finder."""
...
def flow_handler(create: Create):
"""Future entry point to create flow handler."""
...
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment