# Path: trappy/plotter/IPythonConf.py
# D3_PLOTTER_URL = "https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"
# D3_TIP_URL = "https://labratrevenge.com/d3-tip/javascripts/d3.tip.v0.6.3.js"
# DYGRAPH_COMBINED_URL = "https://cdnjs.cloudflare.com/ajax/libs/dygraph/1.1.1/dygraph-combined.js"
# DYGRAPH_SYNC_URL = "https://github.com/danvk/dygraphs/blob/v2.1.0/src/extras/synchronizer.js"
# UNDERSCORE_URL = "https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"
# IPLOT_RESOURCES = {
#     "ILinePlot": [
#         DYGRAPH_COMBINED_URL,
#         "js/ILinePlot.js",
#         DYGRAPH_SYNC_URL,
#         UNDERSCORE_URL],
#     "EventPlot": [
#         D3_PLOTTER_URL,
#         D3_TIP_URL,
#         "js/EventPlot.js",
#         "css/EventPlot_help.jpg"]}
# IPYTHON_V4_BASE = "/nbextensions"
# IPYTHON_V3_BASE = "/static"
# PLOTTER_SCRIPTS = "plotter_scripts"
# def install_http_resource(url, to_path):
# def install_local_resource(from_path, to_path):
# def install_resource(from_path, to_path):
# def iplot_install(module_name):
# def get_ipython():
# def check_ipython():
# def get_profile_name():
# def get_ipython_dir(profile=None):
# def add_web_base(path):
# def get_scripts_path(profile=None):


import os
import argparse
import logging
from IPython.nbformat.sign import TrustNotebookApp
from argparse import RawTextHelpFormatter
from trappy.plotter import IPythonConf
"""
from __future__ import unicode_literals
from __future__ import division
from __future__ import print_function


# Logging Configuration

logging.basicConfig(level=logging.INFO)


def change_resource_paths(txt):
    """Change the resource paths from local to
       Web URLs
    """

    # Replace the path for d3-tip
    txt = txt.replace(
        IPythonConf.add_web_base("plotter_scripts/EventPlot/d3.tip.v0.6.3"),
        IPythonConf.D3_TIP_URL)
    txt = txt.replace(
        IPythonConf.add_web_base("plotter_scripts/EventPlot/d3.v3.min"),
        IPythonConf.D3_PLOTTER_URL)
    txt = txt.replace(
        IPythonConf.add_web_base("plotter_scripts/EventPlot/EventPlot"),
        "https://rawgit.com/sinkap/7f89de3e558856b81f10/raw/46144f8f8c5da670c54f826f0c634762107afc66/EventPlot")
    txt = txt.replace(
        IPythonConf.add_web_base("plotter_scripts/ILinePlot/synchronizer"),
        IPythonConf.DYGRAPH_SYNC_URL)
    txt = txt.replace(

# Path: trappy/plotter/IPythonConf.py
# D3_PLOTTER_URL = "https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"
# D3_TIP_URL = "https://labratrevenge.com/d3-tip/javascripts/d3.tip.v0.6.3.js"
# DYGRAPH_COMBINED_URL = "https://cdnjs.cloudflare.com/ajax/libs/dygraph/1.1.1/dygraph-combined.js"
# DYGRAPH_SYNC_URL = "https://github.com/danvk/dygraphs/blob/v2.1.0/src/extras/synchronizer.js"
# UNDERSCORE_URL = "https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"
# IPLOT_RESOURCES = {
#     "ILinePlot": [
#         DYGRAPH_COMBINED_URL,
#         "js/ILinePlot.js",
#         DYGRAPH_SYNC_URL,
#         UNDERSCORE_URL],
#     "EventPlot": [
#         D3_PLOTTER_URL,
#         D3_TIP_URL,
#         "js/EventPlot.js",
#         "css/EventPlot_help.jpg"]}
# IPYTHON_V4_BASE = "/nbextensions"
# IPYTHON_V3_BASE = "/static"
# PLOTTER_SCRIPTS = "plotter_scripts"
# def install_http_resource(url, to_path):
# def install_local_resource(from_path, to_path):
# def install_resource(from_path, to_path):
# def iplot_install(module_name):
# def get_ipython():
# def check_ipython():
# def get_profile_name():
# def get_ipython_dir(profile=None):
# def add_web_base(path):
# def get_scripts_path(profile=None):


# Path: scripts/publish_interactive_plots.py
import os
import argparse
import logging
from IPython.nbformat.sign import TrustNotebookApp
from argparse import RawTextHelpFormatter
from trappy.plotter import IPythonConf

"""
from __future__ import unicode_literals
from __future__ import division
from __future__ import print_function


# Logging Configuration

logging.basicConfig(level=logging.INFO)


def change_resource_paths(txt):
    """Change the resource paths from local to
       Web URLs
    """

    # Replace the path for d3-tip
    txt = txt.replace(
        IPythonConf.add_web_base("plotter_scripts/EventPlot/d3.tip.v0.6.3"),
        IPythonConf.D3_TIP_URL)
    txt = txt.replace(
        IPythonConf.add_web_base("plotter_scripts/EventPlot/d3.v3.min"),
        IPythonConf.D3_PLOTTER_URL)
    txt = txt.replace(
        IPythonConf.add_web_base("plotter_scripts/EventPlot/EventPlot"),
        "https://rawgit.com/sinkap/7f89de3e558856b81f10/raw/46144f8f8c5da670c54f826f0c634762107afc66/EventPlot")
    txt = txt.replace(
        IPythonConf.add_web_base("plotter_scripts/ILinePlot/synchronizer"),
        IPythonConf.DYGRAPH_SYNC_URL)
    txt = txt.replace(

        IPythonConf.add_web_base("plotter_scripts/ILinePlot/dygraph-combined"),