@@ 25-51 (lines=27) @@ | ||
22 | super(PopulateESCommand, self).__init__(args, kwargs) |
|
23 | self._logger = logging.getLogger(__name__) |
|
24 | ||
25 | def get_parser(self, prog_name): |
|
26 | parser = super(PopulateESCommand, self).get_parser(prog_name) |
|
27 | ||
28 | jobs_help_msg = 'synchronizes the jobs index from the Elasticsearch ' \ |
|
29 | 'database with the jobs table from the Postgresql ' \ |
|
30 | 'database' |
|
31 | parser.add_argument('-j', '--jobs', |
|
32 | help=jobs_help_msg, |
|
33 | dest='synchronize_jobs_index', |
|
34 | action='store_const', const=True) |
|
35 | ||
36 | companies_help_msg = 'synchronizes the companies index from the ' \ |
|
37 | 'Elasticsearch database with the companies ' \ |
|
38 | 'table from the Postgresql database' |
|
39 | parser.add_argument('-co', '--companies', |
|
40 | help=companies_help_msg, |
|
41 | dest='synchronize_companies_index', |
|
42 | action='store_const', const=True) |
|
43 | ||
44 | geocomplete_help_msg = \ |
|
45 | 'populates the geocomplete index of the elasticsearch database' |
|
46 | parser.add_argument('-g', '--geocomplete', |
|
47 | help=geocomplete_help_msg, |
|
48 | dest='populate_geocomplete_index', |
|
49 | action='store_const', const=True) |
|
50 | ||
51 | return parser |
|
52 | ||
53 | def _logging(self, logging_level, message): |
|
54 | self._logger.log(logging_level, message) |
@@ 20-43 (lines=24) @@ | ||
17 | super(PurgeESCommand, self).__init__(args, kwargs) |
|
18 | self._logger = logging.getLogger(__name__) |
|
19 | ||
20 | def get_parser(self, prog_name): |
|
21 | parser = super(PurgeESCommand, self).get_parser(prog_name) |
|
22 | ||
23 | jobs_help_msg = 'purges the jobs index of the elasticsearch database' |
|
24 | parser.add_argument('-j', '--jobs', |
|
25 | help=jobs_help_msg, |
|
26 | dest='purge_jobs_index', |
|
27 | action='store_const', const=True) |
|
28 | ||
29 | companies_help_msg = 'purges the companies index of the elasticsearch' \ |
|
30 | 'database' |
|
31 | parser.add_argument('-co', '--companies', |
|
32 | help=companies_help_msg, |
|
33 | dest='purge_companies_index', |
|
34 | action='store_const', const=True) |
|
35 | ||
36 | geocomplete_help_msg = \ |
|
37 | 'purges the geocomplete index of the elasticsearch database' |
|
38 | parser.add_argument('-g', '--geocomplete', |
|
39 | help=geocomplete_help_msg, |
|
40 | dest='purge_geocomplete_index', |
|
41 | action='store_const', const=True) |
|
42 | ||
43 | return parser |
|
44 | ||
45 | def _logging(self, logging_level, message): |
|
46 | self._logger.log(logging_level, message) |