Added simple implementation of the pre-checker
[mdk.git] / mdk / commands / __init__.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 """
5 Moodle Development Kit
6
7 Copyright (c) 2013 Frédéric Massart - FMCorz.net
8
9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
21
22 http://github.com/FMCorz/mdk
23 """
24
25
26 def getCommand(cmd):
27 """Lazy loading of a command class. Millseconds saved, hurray!"""
28 cls = cmd.capitalize() + 'Command'
29 return getattr(getattr(getattr(__import__('mdk.%s.%s' % ('commands', cmd)), 'commands'), cmd), cls)
30
31 commandsList = [
32 'alias',
33 'backport',
34 'backup',
35 'behat',
36 'config',
37 'create',
38 'css',
39 'doctor',
40 'fix',
41 'info',
42 'init',
43 'install',
44 'js',
45 'phpunit',
46 'plugin',
47 'precheck',
48 'pull',
49 'purge',
50 'push',
51 'rebase',
52 'remove',
53 'run',
54 'tracker',
55 'uninstall',
56 'update',
57 'upgrade'
58 ]