-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
executable file
·55 lines (39 loc) · 1.61 KB
/
main.py
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# -*- coding: utf-8 -*-
import sys
import argparse
from parse_table import prepare_data
from competence_description import print_competence_description
from find_discipline import print_find_discipline
from get_methods import print_get_methods
parser = argparse.ArgumentParser(description='Process doc table.')
parser.add_argument('doc', help='input file')
# parser.add_argument('first_cell', help='first cell in table')
subparsers = parser.add_subparsers(help='sub-command help')
#
parser_competence = subparsers.add_parser('competence',
help='Print competence description: what should know, able and master.')
parser_competence.set_defaults(which='competence')
parser_competence.add_argument('NAME',
help='Name of competence.')
#
parser_competence = subparsers.add_parser('discipline',
help='FInd discipline if it exist.')
parser_competence.set_defaults(which='discipline')
parser_competence.add_argument('NAME',
help='Discipline name.')
#
parser_competence = subparsers.add_parser('methods',
help='Print all from "Methods and technologies formation competence". Duplicate will be removed.')
parser_competence.set_defaults(which='methods')
parser_competence.add_argument('COMPETENCE', nargs='+',
help='Discipline name.')
args = parser.parse_args()
data = prepare_data(args.doc, u"Вид профессиональной деятельности")
assert None != data
# print(args)
if args.which == 'competence':
print_competence_description(data, args.NAME)
if args.which == 'discipline':
print_find_discipline(data, args.NAME)
if args.which == 'methods':
print_get_methods(data, args.COMPETENCE)