GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( cc823b...3d112a )
by PyJobs
9s
created

pyjobsweb.commands.CrawlCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %
Metric Value
wmc 2
dl 0
loc 17
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A CrawlCommand.take_action() 0 5 1
A CrawlCommand.get_parser() 0 9 1
1
# -*- coding: utf-8 -*-
2
import os
3
4
from pyjobs_crawlers.run import start_crawlers
5
6
from crawlers import PyJobsWebConnector
7
from pyjobsweb.commands import AppContextCommand
8
9
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