Пример #1
0
 def setup_server_config(self, EXT_CONFIG):
     # Set the server extension to launch on startup by modifying the
     # jupyter_notebook_config.py
     CONFIG = os.path.join(jupyter_config_dir(), 'jupyter_config.py')
     ensure_dir_exists(jupyter_config_dir())
     if os.path.isfile(CONFIG):
         pass
     else:
         c = JupyterApp()
         c.write_default_config()
     with open(CONFIG, 'r+') as fh:
         lines = fh.read()
         for i in EXT_CONFIG:
             if i not in lines:
                 fh.seek(0, 2)
                 fh.write('\n')
                 fh.write(i)
     print("OUTCOME: Added the Stepsize server extension "
           "configuration to the jupyter_config.py")
Пример #2
0
 def setup_server_config(self, EXT_CONFIG):
     # Set the server extension to launch on startup by modifying the
     # jupyter_notebook_config.py
     CONFIG = os.path.join(jupyter_config_dir(), 'jupyter_config.py')
     ensure_dir_exists(jupyter_config_dir())
     if os.path.isfile(CONFIG):
         pass
     else:
         c = JupyterApp()
         c.write_default_config()
     with open(CONFIG, 'r+') as fh:
         lines = fh.read()
         for i in EXT_CONFIG:
             if i not in lines:
                 fh.seek(0, 2)
                 fh.write('\n')
                 fh.write(i)
     print("OUTCOME: Added the Stepsize server extension "
           "configuration to the jupyter_config.py")