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.
Passed
Push — master ( 094cb0...b11aa0 )
by Benjamin
01:16
created

Updater   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 13
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A check() 0 5 1
A update() 0 2 1
A __init__() 0 3 1
1
import git
2
import os
3
4
5
class Updater(object):
6
    def __init__(self):
7
        self.repo = git.Repo(os.path.dirname(os.path.abspath(__file__)))
8
        self.head = self.repo.remotes.origin
9
10
    def check(self):
11
        self.head.fetch()
12
        diff = self.head.diff()
13
14
        return bool(diff)
15
16
    def update(self):
17
        self.head.pull()