Skip to content
Merged

Fix CI #1118

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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