Permalink
Browse files
move initialization of options_form to __init__
- Loading branch information...
Showing
with
11 additions
and
6 deletions.
-
+0
−4
etc/byor_config.py
-
+1
−1
everware/__init__.py
-
+10
−1
everware/byor_spawner.py
|
|
@@ -3,7 +3,3 @@ |
|
|
load_subconfig('etc/github_auth.py')
|
|
|
|
|
|
c.JupyterHub.spawner_class = 'everware.ByorDockerSpawner'
|
|
|
-
|
|
|
-from os.path import join as pjoin
|
|
|
-with open(pjoin(c.JupyterHub.template_paths[0], '_byor_options_form.html')) as form:
|
|
|
- c.ByorDockerSpawner.options_form = form.read()
|
|
|
@@ -1,4 +1,4 @@ |
|
|
-__version__ = "0.11.0"
|
|
|
+__version__ = "0.12.0"
|
|
|
from .spawner import *
|
|
|
from .byor_spawner import *
|
|
|
from .authenticator import *
|
|
|
|
|
|
@@ -1,3 +1,5 @@ |
|
|
+from os.path import join as pjoin
|
|
|
+
|
|
|
import docker
|
|
|
from docker.errors import DockerException
|
|
|
from traitlets import Int
|
|
|
@@ -7,9 +9,16 @@ |
|
|
|
|
|
|
|
|
class ByorDockerSpawner(CustomDockerSpawner):
|
|
|
+
|
|
|
+ _options_form_is_initialized = False
|
|
|
def __init__(self, **kwargs):
|
|
|
- self._byor_client = None
|
|
|
CustomDockerSpawner.__init__(self, **kwargs)
|
|
|
+ self._byor_client = None
|
|
|
+ if not self._options_form_is_initialized:
|
|
|
+ with open(pjoin(self.config['JupyterHub']['template_paths'][0],
|
|
|
+ '_byor_options_form.html')) as form:
|
|
|
+ ByorDockerSpawner.options_form = form.read()
|
|
|
+ ByorDockerSpawner._options_form_is_initialized = True
|
|
|
|
|
|
@property
|
|
|
def client(self):
|
|
|
|
0 comments on commit
08807ea