Total Complexity | 2 |
Total Lines | 17 |
Duplicated Lines | 0 % |
1 | # -*- coding: utf-8 -*- |
||
10 | class CrawlCommand(AppContextCommand): |
||
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 process)', |
||
17 | dest='processes', default=0) |
||
18 | |||
19 | parser.add_argument("--debug", help='Enable debug', action='store_true') |
||
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 | processes=parsed_args.processes, |
||
26 | debug=parsed_args.debug) |
||
27 |