Default warning in debug mode (#497)

This commit is contained in:
Charlotte Weaver
2018-12-05 13:38:34 -08:00
committed by GitHub
parent 3bfeadc2b9
commit 5c6cc597c8
2 changed files with 11 additions and 9 deletions
+10 -5
View File
@@ -1,11 +1,14 @@
import sys
import click
import logging
from os import devnull
from os.path import splitext, basename
import sys
import warnings
import webbrowser
import click
from server.app.util.errors import ScanpyFileError
from server.app.util.utils import custom_format_warning
@click.command()
@@ -48,9 +51,6 @@ def launch(data, layout, diffexp, title, verbose, debug, obs_names, var_names,
# Startup message
click.echo("[cellxgene] Starting the CLI...")
# Import Flask app
from server.app.app import app
# Argument checking
name, extension = splitext(data)
if extension != ".h5ad":
@@ -59,6 +59,8 @@ def launch(data, layout, diffexp, title, verbose, debug, obs_names, var_names,
if debug:
verbose = True
open_browser = False
else:
warnings.formatwarning = custom_format_warning
if not verbose:
sys.tracebacklimit = 0
@@ -71,6 +73,9 @@ def launch(data, layout, diffexp, title, verbose, debug, obs_names, var_names,
cellxgene_url = f"http://{host}:{port}"
api_base = f"{cellxgene_url}/api/"
# Import Flask app
from server.app.app import app
app.config.update(
DATASET_TITLE=title,
CXG_API_BASE=api_base