File: bar

package info (click to toggle)
pyqi 0.3.2%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 504 kB
  • sloc: python: 2,716; makefile: 133
file content (29 lines) | stat: -rw-r--r-- 909 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env python

__author__ = "b"
__copyright__ = "q"
__credits__ = ["b", "1", "2", "3"]
__license__ = "c"
__version__ = "123"
__maintainer__ = "b"
__email__ = "a"

from __future__ import division
from pyqi.core.command import Command, Parameter
class foo(Command):
    BriefDescription = "FILL IN A 1 SENTENCE DESCRIPTION"
    LongDescription = "GO INTO MORE DETAIL"
    Parameters = ParameterCollection([
        Parameter(Name='foo',Required=True,DataType=str,
                  Help='some required parameter'),
        Parameter(Name='bar',Required=False,DataType=int,
                  Help='some optional parameter',Default=1)
        ])
        
    def run(self, **kwargs):
        # EXAMPLE:
        # return {'result_1': kwargs['foo'] * kwargs['bar'],
        #         'result_2': "Some output bits"}
        raise NotImplementedError("You must define this method")

CommandConstructor = foo