Total Complexity | 2 |
Total Lines | 18 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | # -*- coding: utf-8 -*- |
||
8 | class CrawlCommand(AppContextCommand): |
||
9 | """ |
||
10 | Start job boards crawlers to feed the PostgreSQL database |
||
11 | """ |
||
12 | def get_parser(self, prog_name): |
||
13 | parser = super(CrawlCommand, self).get_parser(prog_name) |
||
14 | |||
15 | parser.add_argument('-p', '--processes', |
||
16 | help='Number of processes used (set 0 to use main ' |
||
17 | 'process)', |
||
18 | dest='processes', default=0) |
||
19 | |||
20 | return parser |
||
21 | |||
22 | def take_action(self, parsed_args): |
||
23 | super(CrawlCommand, self).take_action(parsed_args) |
||
24 | start_crawlers(connector_class=PyJobsWebConnector, |
||
25 | num_processes=parsed_args.processes) |
||
26 |