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 ( d51807...deb84b )
by
unknown
46s
created

stop_singleton()   A

Complexity

Conditions 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
c 1
b 1
f 0
dl 0
loc 2
rs 10
1
#!/usr/bin/python
2
# -*- coding: UTF-8 -*-
3
"""
4
Utils module. Some basic functions that maybe I'll need more than once
5
"""
6
import sys
7
import xbmc, xbmcaddon, xbmcgui
8
from threading import Timer
9
10
__addon__ = xbmcaddon.Addon("script.simkl")
11
12
def getstr(strid):
13
    """ Given an id, returns the localized string """
14
    return __addon__.getLocalizedString(strid)
15
16
def getSetting(settingid):
17
    """ Given an id, return the setting """
18
    ret = __addon__.getSetting(settingid)
19
    xbmc.log("Simkl: {0}: {1}".format(settingid, ret))
20
    if ret == "false": ret = False
21
    return ret
22
23
def systemLock(name):
24
    w = xbmcgui.Window(10000)
25
    if w.getProperty(name) == "True":
26
        xbmc.log('Simkl: already started, ' + name)
27
        sys.exit(0)
28
    w.setProperty(name, "True")
29
30
def systemUnlockDelay(name,delay):
31
    w = xbmcgui.Window(10000)
32
33
    def stop_singleton():
34
        w.clearProperty(name)
35
36
    t = Timer(delay, stop_singleton)
37
    t.start()
38