Make plugins threaded
This commit is contained in:
parent
29a7ad73ff
commit
e2938f6d5e
|
@ -44,6 +44,7 @@ import requests
|
|||
|
||||
class Apixu(callbacks.Plugin):
|
||||
"""apixu weather api client"""
|
||||
threaded = True
|
||||
|
||||
def __init__(self, irc):
|
||||
self.__parent = super(Apixu, self)
|
||||
|
|
|
@ -45,6 +45,7 @@ import timeago
|
|||
|
||||
class GitHub(callbacks.Plugin):
|
||||
"""GitHub rss commit reader"""
|
||||
threaded = True
|
||||
|
||||
def __parse_rss(self, url):
|
||||
response = requests.get(url)
|
||||
|
|
|
@ -44,6 +44,7 @@ import requests
|
|||
|
||||
class Inquisicao(callbacks.Plugin):
|
||||
"""Client for Inquisicao"""
|
||||
threaded = True
|
||||
|
||||
def __init__(self, irc):
|
||||
self.__parent = super(Inquisicao, self)
|
||||
|
|
|
@ -42,6 +42,7 @@ import requests
|
|||
|
||||
class Kernel(callbacks.Plugin):
|
||||
"""Get latest kernel versions"""
|
||||
threaded = True
|
||||
|
||||
def __linus(self):
|
||||
response = requests.get("https://www.kernel.org/releases.json")
|
||||
|
|
|
@ -99,6 +99,7 @@ LastFMDB = plugins.DB('LastFM',
|
|||
|
||||
class LastFM(callbacks.Plugin):
|
||||
"""Last.fm client"""
|
||||
threaded = True
|
||||
|
||||
def __init__(self, irc):
|
||||
self.__parent = super(LastFM, self)
|
||||
|
|
|
@ -43,6 +43,7 @@ import requests
|
|||
|
||||
class Maria(callbacks.Plugin):
|
||||
"""MariaWeb client"""
|
||||
threaded = True
|
||||
|
||||
def __init__(self, irc):
|
||||
self.__parent = super(Maria, self)
|
||||
|
|
|
@ -46,6 +46,7 @@ from bs4 import BeautifulSoup
|
|||
|
||||
class Priberam(callbacks.Plugin):
|
||||
"""Priberam dictionary client"""
|
||||
threaded = True
|
||||
|
||||
def __clean_str(self, text, clean_number=False):
|
||||
text = re.sub(r'\s+', ' ', text)
|
||||
|
@ -81,7 +82,7 @@ class Priberam(callbacks.Plugin):
|
|||
|
||||
total = 0
|
||||
# Only count the definitions that begin with a number
|
||||
# Or the first is there is just one
|
||||
# Or the first, if there is only one, even without a number
|
||||
for idx in range(len(definitions)):
|
||||
if idx > 1 and self.__clean_str(definitions[idx].text)[:1].isdigit() is False:
|
||||
break
|
||||
|
|
Loading…
Reference in New Issue