Terminal API and client for handling terminal management and customized tasks. Closely integrated with specialized api in the main code-base
$ git clone https://github.com/devilry/devilry-terminal-client.git
$ cd devilry-terminal-client
$ pip install .
$ devil
usage: devil [-h] {assignment,assignment-group,feedbackset,group-comment} ...
devil: error: too few arguments
Become a real devil and create your own scritps!
Example cli.py:
from devilry.utils.basescript import BaseScript
class MyScript(BaseScript):
command = 'my-script'
@classmethod
def add_to_subparser(cls, subparser):
parser = subparser.add_parser(cls.command, help='my super cool script')
parser.add_argument('--my-cool-argument', dest='my_arg', require=True)
parser.set_defaults(func=MyScript.run)
@classmethod
def run(cls, args):
...
Install your script here here:
$ tree
├── devilry
│ ├── external_scripts
| | ├── myscript
| | | ├── cli.py
| | ├── ...
│ | ├── config.py
| ├── ...
├── ...
Register your script in config.py
..
from devilry.external_scripts.myscript.cli import MyScript
INSTALLED_SCRIPTS = [
...
MyScript,
]
This is not supported yet, but here is the idea.
-
Create a directory for your local scripts in your home directory:
$ mkdir /home/$USER/devilry_scripts
-
Export your local script folder path to your environment:
$ export DEVILRY_LOCAL_SCRIPTS = /home/$USER/devilry_scripts
-
Create your config.py file:
... from myscrip.cli import MyScript INSTALLED_SCRIPTS = [ ... MyScript, ]
-
Your script folder should look like this:
$ pwd /home/user/devilry_scripts $ tree ├── myscript | ├── cli.py | ... └── config.py