Skip to content

Terminal API and client for handling terminal management and customized tasks. Closely integrated with specialized api in the main code-base

Notifications You must be signed in to change notification settings

devilry/devilry-terminal-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

devilry-terminal-client

Terminal API and client for handling terminal management and customized tasks. Closely integrated with specialized api in the main code-base

Install from git repo

$ 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

How to create scripts

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):
        ...

External scripts

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,
]

Local scripts

This is not supported yet, but here is the idea.

  1. Create a directory for your local scripts in your home directory:

    $ mkdir /home/$USER/devilry_scripts
    
  2. Export your local script folder path to your environment:

    $ export DEVILRY_LOCAL_SCRIPTS = /home/$USER/devilry_scripts
    
  3. Create your config.py file:

    ...
    from myscrip.cli import MyScript
    INSTALLED_SCRIPTS = [
        ...
        MyScript,
    ]
  4. Your script folder should look like this:

    $ pwd
    /home/user/devilry_scripts
    $ tree
    ├── myscript
    |   ├── cli.py
    |   ...
    └── config.py
    

About

Terminal API and client for handling terminal management and customized tasks. Closely integrated with specialized api in the main code-base

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages