Skip to content

Commit

Permalink
Merge pull request #1118 from trungleduc/fix-ci
Browse files Browse the repository at this point in the history
Fix CI
  • Loading branch information
martinRenou authored Mar 22, 2022
2 parents 749ac53 + cc93aa4 commit 02428d5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
4 changes: 1 addition & 3 deletions voila/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@

from jupyter_core.paths import jupyter_config_path, jupyter_path

from ipython_genutils.py3compat import getcwd

from .paths import ROOT, STATIC_ROOT, collect_template_paths, collect_static_paths
from .handler import VoilaHandler
from .treehandler import VoilaTreeHandler
Expand Down Expand Up @@ -322,7 +320,7 @@ def _default_root_dir(self):
if self.notebook_path:
return os.path.dirname(os.path.abspath(self.notebook_path))
else:
return getcwd()
return os.getcwd()

def _init_asyncio_patch(self):
"""set default asyncio policy to be compatible with tornado
Expand Down
14 changes: 14 additions & 0 deletions voila/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,20 @@ def inner():
os.environ[k] = v


def get_query_string(url: str = None) -> str:
"""Helper function to pause the execution of notebook and wait for
the query string.
Args:
url (str, optional): Address to get user query string, if it is not
provided, `voila` will figure out from the environment variables.
Defaults to None.
Returns: The query string provided by `QueryStringSocketHandler`.
"""

wait_for_request(url)
return os.getenv(ENV_VARIABLE.QUERY_STRING)


def make_url(template_name, base_url, path):
# similar to static_url, but does not assume the static prefix
settings = {
Expand Down

0 comments on commit 02428d5

Please sign in to comment.