Skip to content

Commit

Permalink
LabHub: Use activate instead of init
Browse files Browse the repository at this point in the history
__init__ is executed at load time and
and any issue in the plugin will lead
to it not showing up.
LifeCycle: __init__->configured->enable

Closes #554
  • Loading branch information
nvzard committed Jul 16, 2018
1 parent 861f7f8 commit 5804c5c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions plugins/labhub.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ class LabHub(BotPlugin):
GH_ORG_NAME = constants.GH_ORG_NAME
GL_ORG_NAME = constants.GL_ORG_NAME

def __init__(self, bot, name=None):
super().__init__(bot, name)

def activate(self):
teams = dict()
try:
gh = github3.login(token=os.environ.get('GH_TOKEN'))
Expand Down Expand Up @@ -62,6 +60,7 @@ def __init__(self, bot, name=None):
self.REPOS.update(self.gl_repos)

self.hello_world_users = set()
super(LabHub, self).activate()

@property
def TEAMS(self):
Expand Down

0 comments on commit 5804c5c

Please sign in to comment.