options_creator.py
622 Bytes
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys, os, pickle
from multiservice.facade.ttypes import OptionInfo, OptionType
options = []
for file in os.listdir('../../config/dictionaryannotator'):
if file.endswith('.bin'):
dictionaryName=file[:file.find('.')]
dictionaryName=dictionaryName[0].upper()+dictionaryName[1:]
options.append(
OptionInfo(
name='use'+dictionaryName,
type=OptionType.BOOLEAN,
defaultValue='true'
)
)
pickle.dump(options, open("../../config/dictionaryannotator/options.pickle", "wb" ))