port python2.x code to python3.x
[tools/repa.git] / examples / plugin / repa_plugin / plugin.py
1 #!/usr/bin/env python
2 #
3 # This file is part of REPA: Release Engineering Process Assistant.
4 #
5 # Copyright (C) 2013 Intel Corporation
6 #
7 # REPA is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU General Public License
9 # version 2 as published by the Free Software Foundation.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20
21 """
22 REPA: Release Engineering Process Assistant.
23
24 Copyright (C) Intel Corporation 2013
25 Licence: GPL version 2
26 Author: Ed Bartosh <eduard.bartosh@intel.com>
27
28 Test repa command plugin.
29 After installation new command 'test' will be added to repa
30 """
31
32 import sys
33
34 from repa.main import sub_main
35
36 class Test(object):
37     """Subcommand: test."""
38
39     name = 'test'
40     description = 'Test repa command plugin'
41     help = description
42
43     @staticmethod
44     def add_arguments(parser):
45         """Adds arguments to the parser. Called from [sub_]main."""
46         parser.add_argument('--opt', help='test option')
47
48     def run(self, argv):
49         """Command line entry point."""
50         print('%s: Not implemented yet' % self.help)
51         print('paremeter: %s' % argv.opt)
52
53
54 if __name__ == '__main__':
55     sys.exit(sub_main(sys.argv[1:], Test()))