Skip to content
Snippets Groups Projects
Commit 4f4f42c7bebf authored by Adrien Di Mascio's avatar Adrien Di Mascio
Browse files

[ccplugin] change --etype option to --etypes

same thing for --except_etype
parent 7eebe9f503ee
No related branches found
No related tags found
No related merge requests found
......@@ -39,12 +39,12 @@
('debug', {'type': 'yn', 'default': False,
'help': 'set to True if you want to print'
'out debug info and progress'}),
('etype', {'type': 'string', 'default': '',
'help': 'only index a given etype'
'[default:all indexable types]'}),
('except-etype', {'type': 'string', 'default': '',
'help': 'all indexable types except given etype'
'[default:None]'}),
('etypes', {'type': 'csv', 'default': '',
'help': 'only index given etypes '
'[default:all indexable types]'}),
('except-etypes', {'type': 'string', 'default': '',
'help': 'all indexable types except given etypes'
'[default: []]'}),
]
def run(self, args):
......@@ -56,7 +56,7 @@
es = indexer.get_connection()
indexer.create_index()
if es:
if self.config.etype:
etypes = (self.config.etype,)
if self.config.etypes:
etypes = self.config.etypes
else:
etypes = indexable_types(schema,
......@@ -61,8 +61,8 @@
else:
etypes = indexable_types(schema,
custom_skip_list=((self.config.except_etype,)))
assert self.config.except_etype not in etypes
if self.config.debug and not self.config.etype:
custom_skip_list=self.config.except_etypes)
assert self.config.except_etypes not in etypes
if self.config.debug and not self.config.etypes:
print(u'found indexable_types {}'.format(
','.join(etypes)))
for _ in parallel_bulk(es,
......
......@@ -41,6 +41,6 @@
if INDEXABLE_TYPES is not None:
return INDEXABLE_TYPES
indexable_types = []
skip_list = ('TrInfo', 'EmailAddress')
skip_list = ['TrInfo', 'EmailAddress']
if custom_skip_list:
skip_list = skip_list + custom_skip_list
......@@ -45,6 +45,5 @@
if custom_skip_list:
skip_list = skip_list + custom_skip_list
print skip_list
for eschema in schema.entities():
if eschema.type in skip_list:
continue
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment