[Python-modules-commits] [jupyter-notebook] 01/14: Import jupyter-notebook_5.2.1.orig.tar.gz

Gordon Ball chronitis-guest at moszumanska.debian.org
Sun Nov 12 20:26:14 UTC 2017


This is an automated email from the git hooks/post-receive script.

chronitis-guest pushed a commit to branch master
in repository jupyter-notebook.

commit 2d11329b4c2d8c690d320bfe7a7cf98c12d84b1b
Author: Gordon Ball <gordon at chronitis.net>
Date:   Thu Nov 9 15:11:08 2017 +0000

    Import jupyter-notebook_5.2.1.orig.tar.gz
---
 .gitignore                                         |    1 +
 .travis.yml                                        |   15 +-
 CONTRIBUTING.rst                                   |    4 +-
 bower.json                                         |    2 +-
 docs/source/changelog.rst                          |   23 +
 docs/source/conf.py                                |    7 +
 docs/source/config_overview.rst                    |    2 +-
 ...ing Jupyter Extensions as Python Packages.ipynb |    8 +-
 .../examples/Notebook/Importing Notebooks.ipynb    |    2 +-
 .../Notebook/JavaScript Notebook Extensions.ipynb  |    4 +-
 .../examples/Notebook/Typesetting Equations.ipynb  |    6 +-
 .../Notebook/What is the Jupyter Notebook.ipynb    |   12 +-
 .../Notebook/Working With Markdown Cells.ipynb     |    2 +-
 docs/source/extending/contents.rst                 |    2 +-
 docs/source/links.txt                              |    2 +-
 docs/source/notebook.rst                           |    4 +-
 docs/source/public_server.rst                      |    8 +-
 notebook/_version.py                               |    2 +-
 notebook/base/handlers.py                          |   92 +-
 notebook/bundler/tarball_bundler.py                |    7 +-
 notebook/bundler/zip_bundler.py                    |    3 +-
 notebook/files/handlers.py                         |   26 +-
 notebook/i18n/nbjs.json                            |    1 +
 notebook/i18n/zh-CN/LC_MESSAGES/nbjs.po            | 2334 ++++++++++++++++++++
 notebook/i18n/zh-CN/LC_MESSAGES/nbui.po            |  731 ++++++
 notebook/i18n/zh-CN/LC_MESSAGES/notebook.po        |  485 ++++
 notebook/nbconvert/handlers.py                     |   56 +-
 notebook/notebookapp.py                            |    8 +-
 notebook/services/api/handlers.py                  |    3 +-
 notebook/services/config/handlers.py               |    5 +-
 notebook/services/contents/filemanager.py          |    4 +
 notebook/services/contents/handlers.py             |   12 +-
 notebook/services/contents/manager.py              |   51 +-
 notebook/services/contents/tests/test_manager.py   |    6 +
 notebook/services/kernels/handlers.py              |   69 +-
 notebook/services/kernels/kernelmanager.py         |  121 +-
 notebook/services/kernelspecs/handlers.py          |    4 +-
 notebook/services/nbconvert/handlers.py            |    3 +-
 notebook/services/security/handlers.py             |    3 +-
 notebook/services/sessions/handlers.py             |    7 +-
 notebook/static/auth/js/main.js                    |    5 +-
 notebook/static/auth/less/login.less               |   19 +-
 notebook/static/base/js/namespace.js               |    2 +-
 notebook/static/base/js/page.js                    |    4 +-
 notebook/static/base/less/page.less                |   15 +-
 notebook/static/bidi/bidi.js                       |   57 +
 notebook/static/bidi/numericshaping.js             |   42 +
 notebook/static/custom/custom.css                  |   16 +-
 notebook/static/edit/js/editor.js                  |   12 +-
 notebook/static/edit/js/main.js                    |    5 +-
 notebook/static/edit/js/menubar.js                 |    2 +-
 notebook/static/edit/js/savewidget.js              |    8 +-
 notebook/static/notebook/js/cell.js                |    2 -
 notebook/static/notebook/js/main.js                |    7 +-
 notebook/static/notebook/js/notebook.js            |    2 +-
 notebook/static/notebook/js/notificationarea.js    |   17 +-
 notebook/static/notebook/js/outputarea.js          |   12 +-
 notebook/static/notebook/js/quickhelp.js           |    7 +-
 notebook/static/notebook/js/savewidget.js          |    7 +-
 notebook/static/notebook/less/codemirror.less      |   27 +-
 notebook/static/notebook/less/commandpalette.less  |   25 +
 notebook/static/notebook/less/kernelselector.less  |    4 +
 notebook/static/notebook/less/menubar.less         |   61 +
 .../static/notebook/less/notificationarea.less     |   18 +
 notebook/static/notebook/less/renderedhtml.less    |    7 +
 notebook/static/notebook/less/savewidget.less      |   11 +
 notebook/static/notebook/less/toolbar.less         |    3 +
 notebook/static/tree/js/main.js                    |    6 +-
 notebook/static/tree/js/notebooklist.js            |   55 +-
 notebook/static/tree/js/sessionlist.js             |    8 +-
 notebook/static/tree/less/tree.less                |   51 +
 notebook/templates/notebook.html                   |    2 +-
 notebook/templates/page.html                       |    5 +-
 notebook/terminal/api_handlers.py                  |    6 +-
 notebook/tests/notebook/roundtrip.js               |   15 +-
 notebook/tests/test_files.py                       |    2 +-
 notebook/tests/test_utils.py                       |    6 +-
 notebook/utils.py                                  |    7 +
 package.json                                       |    3 +-
 setup.py                                           |    2 +-
 80 files changed, 4451 insertions(+), 251 deletions(-)

diff --git a/.gitignore b/.gitignore
index 2c2eb30..028aba9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,7 @@ docs/man/*.gz
 docs/source/api/generated
 docs/source/config.rst
 docs/gh-pages
+notebook/i18n/*/*.mo
 notebook/static/components
 notebook/static/style/*.min.css*
 notebook/static/*/js/built/
diff --git a/.travis.yml b/.travis.yml
index 79ebba5..d4ee8b8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,7 +5,7 @@ cache:
     directories:
         - $HOME/.cache/bower
 python:
-    - 3.5.1  # Set to 3.5.1 since travis has not yet included as default for 3.5
+    - 3.6
     - 2.7
 
 sudo: required
@@ -48,14 +48,21 @@ install:
 script:
     - 'if [[ $GROUP == js* ]]; then travis_retry python -m notebook.jstest ${GROUP:3}; fi'
     - 'if [[ $GROUP == python ]]; then nosetests -v --with-coverage --cover-package=notebook notebook; fi'
-    - 'if [[ $GROUP == docs ]]; then make -C docs/ html; fi'
+    - |
+      if [[ $GROUP == docs ]]; then
+        EXIT_STATUS=0
+        make -C docs/ html || EXIT_STATUS=$?
+        make -C docs/ linkcheck || EXIT_STATUS=$?
+        pytest --nbval --current-env docs || EXIT_STATUS=$?
+        exit $EXIT_STATUS
+      fi
 
 matrix:
     include:
-        - python: 3.3
-          env: GROUP=python
         - python: 3.4
           env: GROUP=python
+        - python: 3.5
+          env: GROUP=python
     exclude:
         - python: 2.7
           env: GROUP=docs
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index 0c0a61f..829475a 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -32,7 +32,7 @@ If you use ``conda``, you can get them with::
 
     conda install -c conda-forge nodejs
 
-If you use `Homebrew <http://brew.sh/>`_ on Mac OS X::
+If you use `Homebrew <https://brew.sh/>`_ on Mac OS X::
 
     brew install node
 
@@ -152,7 +152,7 @@ containing all the necessary packages (except pandoc), use::
     activate notebook_docs         # Windows
 
 .. _conda environment:
-    http://conda.pydata.org/docs/using/envs.html#use-environment-from-file
+    https://conda.io/docs/user-guide/tasks/manage-environments.html#creating-an-environment-from-an-environment-yml-file
 
 If you want to install the necessary packages with ``pip`` instead::
 
diff --git a/bower.json b/bower.json
index 52ca303..3a97e14 100644
--- a/bower.json
+++ b/bower.json
@@ -24,6 +24,6 @@
     "requirejs-plugins": "~1.0.3",
     "text-encoding": "~0.1",
     "underscore": "components/underscore#~1.8.3",
-    "xterm.js": "sourcelair/xterm.js#~2.8.1"
+    "xterm.js": "sourcelair/xterm.js#~2.9.2"
   }
 }
diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst
index ebbda56..171682e 100644
--- a/docs/source/changelog.rst
+++ b/docs/source/changelog.rst
@@ -21,6 +21,29 @@ We strongly recommend that you upgrade to version 9+ of pip before upgrading ``n
     ``pip --version``.
 
 
+.. _release-5.2.0:
+
+5.2.0
+-----
+
+- Make all files in the dashboard editable by default and provide a whitelist of viewable file extensions (:ghpull:`2911`).
+- Ensure that the root directory is not hidden (:ghpull:`2907`).
+- Fix CodeMirror styling issue (:ghpull:`2880`).
+- Update error handling on ``APIHandlers`` (:ghpull:`2853`).
+- Upgrade xterm.js to 2.9.2 (:ghpull:`2849`).
+- Add Chinese translations (depends on upcoming UI implementation) (:ghpull:`2804`).
+- Allow for simpler customization of ``output_prompt`` in custom.js (:ghpull:`2774`).
+- Use RFC5987 encoding for filenames (:ghpull:`2767`).
+- Add path to the resources metadata (:ghpull:`2753`).
+- Make ``extraKeys`` consistent between notebook and editor views (:ghpull:`2745`).
+- Add RTL (right-to-left) support (:ghpull:`2357`).
+
+Special thanks to `samarsultan <https://github.com/samarsultan>`__ and the Arabic Competence and Globalization Center Team at IBM Egypt for adding RTL (right-to-left) support to the notebook!
+
+See the 5.2 milestone on GitHub for a complete list of
+`issues <https://github.com/jupyter/notebook/issues?utf8=%E2%9C%93&q=is%3Aissue%20milestone%3A5.2>`__
+and `pull requests <https://github.com/jupyter/notebook/pulls?utf8=%E2%9C%93&q=is%3Apr%20milestone%3A5.2>`__ involved in this release.
+
 .. _release-5.1.0:
 
 5.1.0
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 0362a41..b8249a8 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -313,6 +313,13 @@ man_pages = [
 #man_show_urls = False
 
 
+# -- Options for link checks ----------------------------------------------
+
+linkcheck_ignore = [
+    'http://127\.0\.0\.1/*'
+]
+
+
 # -- Options for Texinfo output -------------------------------------------
 
 # Grouping the document tree into Texinfo files. List of tuples
diff --git a/docs/source/config_overview.rst b/docs/source/config_overview.rst
index 3fcc51e..f0d80d8 100644
--- a/docs/source/config_overview.rst
+++ b/docs/source/config_overview.rst
@@ -47,7 +47,7 @@ front-end Notebook client (i.e. the familiar notebook interface).
         documented in the configuration file and the user documentation.
 
   - :ref:`Running a Notebook server <working_remotely>`
-  - Related: `Configuring a language kernel <https://jupyter.readthedocs.io/en/latest/install.html#installing-kernels>`_
+  - Related: `Configuring a language kernel <https://jupyter.readthedocs.io/en/latest/install-kernel.html>`_
     to run in the Notebook server enables your server to run other languages, like R or Julia.
 
 .. _configure_nbclient:
diff --git a/docs/source/examples/Notebook/Distributing Jupyter Extensions as Python Packages.ipynb b/docs/source/examples/Notebook/Distributing Jupyter Extensions as Python Packages.ipynb
index ac13dd2..43e2d1b 100644
--- a/docs/source/examples/Notebook/Distributing Jupyter Extensions as Python Packages.ipynb	
+++ b/docs/source/examples/Notebook/Distributing Jupyter Extensions as Python Packages.ipynb	
@@ -124,14 +124,14 @@
     "\n",
     "> Of course, in addition to the files listed, there are number of other files one needs to build a proper package. Here are some good resources:\n",
     "- [The Hitchhiker's Guide to Packaging](https://the-hitchhikers-guide-to-packaging.readthedocs.io/en/latest/quickstart.html)\n",
-    "- [Repository Structure and Python](http://www.kennethreitz.org/essays/repository-structure-and-python) by Kenneth Reitz\n",
+    "- [Repository Structure and Python](https://www.kennethreitz.org/essays/repository-structure-and-python) by Kenneth Reitz\n",
     "\n",
     "> How you distribute them, too, is important:\n",
-    "- [Packaging and Distributing Projects](https://python-packaging-user-guide.readthedocs.io/distributing/)\n",
-    "- [conda: Building packages](http://conda.pydata.org/docs/building/build.html)\n",
+    "- [Packaging and Distributing Projects](https://python-packaging-user-guide.readthedocs.io/tutorials/distributing-packages/)\n",
+    "- [conda: Building packages](https://conda.io/docs/building/build.html)\n",
     "\n",
     "> Here are some tools to get you started:\n",
-    "- [generator-nbextension](https://github.com/Anaconda-Server/generator-nbextension)"
+    "- [generator-nbextension](https://github.com/Anaconda-Platform/generator-nbextension)"
    ]
   },
   {
diff --git a/docs/source/examples/Notebook/Importing Notebooks.ipynb b/docs/source/examples/Notebook/Importing Notebooks.ipynb
index d6db539..c878f0d 100644
--- a/docs/source/examples/Notebook/Importing Notebooks.ipynb	
+++ b/docs/source/examples/Notebook/Importing Notebooks.ipynb	
@@ -15,7 +15,7 @@
     "This is made difficult by the fact that Notebooks are not plain Python files,\n",
     "and thus cannot be imported by the regular Python machinery.\n",
     "\n",
-    "Fortunately, Python provides some fairly sophisticated [hooks](http://www.python.org/dev/peps/pep-0302/) into the import machinery,\n",
+    "Fortunately, Python provides some fairly sophisticated [hooks](https://www.python.org/dev/peps/pep-0302/) into the import machinery,\n",
     "so we can actually make Jupyter notebooks importable without much difficulty,\n",
     "and only using public APIs."
    ]
diff --git a/docs/source/examples/Notebook/JavaScript Notebook Extensions.ipynb b/docs/source/examples/Notebook/JavaScript Notebook Extensions.ipynb
index e43d767..4237a18 100644
--- a/docs/source/examples/Notebook/JavaScript Notebook Extensions.ipynb	
+++ b/docs/source/examples/Notebook/JavaScript Notebook Extensions.ipynb	
@@ -344,7 +344,7 @@
     "        {\n",
     "             'label'   : 'run qtconsole',\n",
     "             'icon'    : 'fa-terminal', // select your icon from \n",
-    "                                          // http://fortawesome.github.io/Font-Awesome/icons/\n",
+    "                                          // http://fontawesome.io/icons/\n",
     "             'callback': function(){Jupyter.notebook.kernel.execute('%qtconsole')}\n",
     "        }\n",
     "        // add more button here if needed.\n",
@@ -352,7 +352,7 @@
     "```\n",
     "with a [lot of icons] you can select from. \n",
     "\n",
-    "[lot of icons]: http://fortawesome.github.io/Font-Awesome/icons/"
+    "[lot of icons]: http://fontawesome.io/icons/"
    ]
   },
   {
diff --git a/docs/source/examples/Notebook/Typesetting Equations.ipynb b/docs/source/examples/Notebook/Typesetting Equations.ipynb
index b57e2bb..4d8f5f9 100644
--- a/docs/source/examples/Notebook/Typesetting Equations.ipynb	
+++ b/docs/source/examples/Notebook/Typesetting Equations.ipynb	
@@ -4,7 +4,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "The Markdown parser included in the Jupyter Notebook is MathJax-aware.  This means that you can freely mix in mathematical expressions using the [MathJax subset of Tex and LaTeX](http://docs.mathjax.org/en/latest/tex.html#tex-support).  [Some examples from the MathJax site](http://www.mathjax.org/demos/tex-samples/) are reproduced below, as well as the Markdown+TeX source."
+    "The Markdown parser included in the Jupyter Notebook is MathJax-aware.  This means that you can freely mix in mathematical expressions using the [MathJax subset of Tex and LaTeX](http://docs.mathjax.org/en/latest/tex.html#tex-support).  [Some examples from the MathJax site](https://www.mathjax.org/demos/tex-samples/) are reproduced below, as well as the Markdown+TeX source."
    ]
   },
   {
@@ -177,11 +177,11 @@
     "\n",
     "### Source\n",
     "```\n",
-    "This expression $\\sqrt{3x-1}+(1+x)^2$ is an example of a TeX inline equation in a [Markdown-formatted](http://daringfireball.net/projects/markdown/) sentence.  \n",
+    "This expression $\\sqrt{3x-1}+(1+x)^2$ is an example of a TeX inline equation in a [Markdown-formatted](https://daringfireball.net/projects/markdown/) sentence.  \n",
     "```\n",
     "\n",
     "### Display\n",
-    "This expression $\\sqrt{3x-1}+(1+x)^2$ is an example of a TeX inline equation in a [Markdown-formatted](http://daringfireball.net/projects/markdown/) sentence.  "
+    "This expression $\\sqrt{3x-1}+(1+x)^2$ is an example of a TeX inline equation in a [Markdown-formatted](https://daringfireball.net/projects/markdown/) sentence.  "
    ]
   },
   {
diff --git a/docs/source/examples/Notebook/What is the Jupyter Notebook.ipynb b/docs/source/examples/Notebook/What is the Jupyter Notebook.ipynb
index af9b187..0b64a15 100644
--- a/docs/source/examples/Notebook/What is the Jupyter Notebook.ipynb	
+++ b/docs/source/examples/Notebook/What is the Jupyter Notebook.ipynb	
@@ -31,7 +31,7 @@
     "- Images\n",
     "- Video\n",
     "\n",
-    "These documents provide a **complete and self-contained record of a computation** that can be converted to various formats and shared with others using email, [Dropbox](http://dropbox.com), version control systems (like git/[GitHub](http://github.com)) or [nbviewer.jupyter.org](http://nbviewer.jupyter.org)."
+    "These documents provide a **complete and self-contained record of a computation** that can be converted to various formats and shared with others using email, [Dropbox](https://www.dropbox.com/), version control systems (like git/[GitHub](https://github.com)) or [nbviewer.jupyter.org](http://nbviewer.jupyter.org)."
    ]
   },
   {
@@ -79,7 +79,7 @@
     "* See the results of computations with **rich media representations**, such as HTML, LaTeX, PNG, SVG, PDF, etc.\n",
     "* Create and use **interactive JavaScript widgets**, which bind interactive user interface controls and visualizations to reactive kernel side computations.\n",
     "* Author **narrative text** using the [Markdown](https://daringfireball.net/projects/markdown/) markup language.\n",
-    "* Include mathematical equations using **LaTeX syntax in Markdown**, which are rendered in-browser by [MathJax](http://www.mathjax.org/)."
+    "* Include mathematical equations using **LaTeX syntax in Markdown**, which are rendered in-browser by [MathJax](https://www.mathjax.org/)."
    ]
   },
   {
@@ -101,7 +101,7 @@
     "\n",
     "* Python(https://github.com/ipython/ipython)\n",
     "* Julia (https://github.com/JuliaLang/IJulia.jl)\n",
-    "* R (https://github.com/takluyver/IRkernel)\n",
+    "* R (https://github.com/IRkernel/IRkernel)\n",
     "* Ruby (https://github.com/minrk/iruby)\n",
     "* Haskell (https://github.com/gibiansky/IHaskell)\n",
     "* Scala (https://github.com/Bridgewater/scala-notebook)\n",
@@ -149,11 +149,11 @@
     "* **Heading cells:** 6 levels of hierarchical organization and formatting\n",
     "* **Raw cells:** Unformatted text that is included, without modification, when notebooks are converted to different formats using nbconvert\n",
     "\n",
-    "Internally, notebook documents are **[JSON](http://en.wikipedia.org/wiki/JSON) data** with **binary values [base64](http://en.wikipedia.org/wiki/Base64)** encoded. This allows them to be **read and manipulated programmatically** by any programming language. Because JSON is a text format, notebook documents are version control friendly.\n",
+    "Internally, notebook documents are **[JSON](https://en.wikipedia.org/wiki/JSON) data** with **binary values [base64](http://en.wikipedia.org/wiki/Base64)** encoded. This allows them to be **read and manipulated programmatically** by any programming language. Because JSON is a text format, notebook documents are version control friendly.\n",
     "\n",
-    "**Notebooks can be exported** to different static formats including HTML, reStructeredText, LaTeX, PDF, and slide shows ([reveal.js](http://lab.hakim.se/reveal-js/#/)) using Jupyter's `nbconvert` utility.\n",
+    "**Notebooks can be exported** to different static formats including HTML, reStructeredText, LaTeX, PDF, and slide shows ([reveal.js](http://lab.hakim.se/reveal-js/)) using Jupyter's `nbconvert` utility.\n",
     "\n",
-    "Furthermore, any notebook document available from a **public URL on or GitHub can be shared** via [nbviewer](http://nbviewer.ipython.org). This service loads the notebook document from the URL and renders it as a static web page. The resulting web page may thus be shared with others **without their needing to install the Jupyter Notebook**."
+    "Furthermore, any notebook document available from a **public URL on or GitHub can be shared** via [nbviewer](http://nbviewer.jupyter.org). This service loads the notebook document from the URL and renders it as a static web page. The resulting web page may thus be shared with others **without their needing to install the Jupyter Notebook**."
    ]
   }
  ],
diff --git a/docs/source/examples/Notebook/Working With Markdown Cells.ipynb b/docs/source/examples/Notebook/Working With Markdown Cells.ipynb
index b7ccc62..3942603 100644
--- a/docs/source/examples/Notebook/Working With Markdown Cells.ipynb	
+++ b/docs/source/examples/Notebook/Working With Markdown Cells.ipynb	
@@ -13,7 +13,7 @@
    "source": [
     "Text can be added to Jupyter Notebooks using Markdown cells.  Markdown is a popular markup language that is a superset of HTML. Its specification can be found here:\n",
     "\n",
-    "<http://daringfireball.net/projects/markdown/>"
+    "<https://daringfireball.net/projects/markdown/>"
    ]
   },
   {
diff --git a/docs/source/extending/contents.rst b/docs/source/extending/contents.rst
index c295cde..5216d67 100644
--- a/docs/source/extending/contents.rst
+++ b/docs/source/extending/contents.rst
@@ -216,4 +216,4 @@ ContentsManager.
 
 .. _NBFormat: https://nbformat.readthedocs.io/en/latest/index.html
 .. _PGContents: https://github.com/quantopian/pgcontents
-.. _PostgreSQL: http://www.postgresql.org/
+.. _PostgreSQL: https://www.postgresql.org/
diff --git a/docs/source/links.txt b/docs/source/links.txt
index 46b932b..710ef8c 100644
--- a/docs/source/links.txt
+++ b/docs/source/links.txt
@@ -30,7 +30,7 @@
 .. _nbconvert: https://nbconvert.readthedocs.io/en/latest/
 
 .. Other tools and projects
-.. _Markdown: http://daringfireball.net/projects/markdown/syntax
+.. _Markdown: https://daringfireball.net/projects/markdown/syntax
 
 .. _Rich Output: notebook_p5_
 .. _notebook_p5: https://nbviewer.jupyter.org/github/ipython/ipython/blob/master/examples/IPython%20Kernel/Rich%20Output.ipynb
diff --git a/docs/source/notebook.rst b/docs/source/notebook.rst
index c1ad640..e60ff82 100644
--- a/docs/source/notebook.rst
+++ b/docs/source/notebook.rst
@@ -47,7 +47,7 @@ Main features of the web application
 
 
 
-.. _MathJax: http://www.mathjax.org/
+.. _MathJax: https://www.mathjax.org/
 
 
 Notebook documents
@@ -61,7 +61,7 @@ are internally JSON_ files and are saved with the ``.ipynb`` extension. Since
 JSON is a plain text format, they can be version-controlled and shared with
 colleagues.
 
-.. _JSON: http://en.wikipedia.org/wiki/JSON
+.. _JSON: https://en.wikipedia.org/wiki/JSON
 
 Notebooks may be exported to a range of static formats, including HTML (for
 example, for blog posts), reStructuredText, LaTeX, PDF, and slide shows, via
diff --git a/docs/source/public_server.rst b/docs/source/public_server.rst
index fd079b5..e22e43c 100644
--- a/docs/source/public_server.rst
+++ b/docs/source/public_server.rst
@@ -32,7 +32,7 @@ This document describes how you can
     To use JupyterHub, you need a Unix server (typically Linux) running
     somewhere that is accessible to your users on a network. This may run over
     the public internet, but doing so introduces additional
-    `security concerns <https://jupyterhub.readthedocs.io/en/latest/getting-started.html#security>`_.
+    `security concerns <https://jupyterhub.readthedocs.io/en/latest/getting-started/security-basics.html>`_.
 
 
 
@@ -134,7 +134,7 @@ with the command::
     the following command will create a certificate valid for 365 days with
     both the key and certificate data written to the same file::
 
-        $ openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mykey.key -out mycert.pem
+        $ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mykey.key -out mycert.pem
 
 When starting the notebook server, your browser may warn that your self-signed
 certificate is insecure or unrecognized.  If you wish to have a fully
@@ -145,7 +145,7 @@ certificate and follow the steps in :ref:`using-lets-encrypt` to set up a
 public server.
 
 .. _OWASP: https://www.owasp.org
-.. _tutorial: http://arstechnica.com/security/news/2009/12/how-to-get-set-with-a-secure-sertificate-for-free.ars
+.. _tutorial: https://arstechnica.com/information-technology/2009/12/how-to-get-set-with-a-secure-sertificate-for-free/
 
 .. _notebook_public_server:
 
@@ -326,7 +326,7 @@ Docker CMD
 ~~~~~~~~~~
 
 Using ``jupyter notebook`` as a
-`Docker CMD <https://docs.docker.com/reference/builder/#cmd>`_ results in
+`Docker CMD <https://docs.docker.com/engine/reference/builder/#cmd>`_ results in
 kernels repeatedly crashing, likely due to a lack of `PID reaping
 <https://blog.phusion.nl/2015/01/20/docker-and-the-pid-1-zombie-reaping-problem/>`_.
 To avoid this, use the `tini <https://github.com/krallin/tini>`_ ``init`` as your
diff --git a/notebook/_version.py b/notebook/_version.py
index 49ee02d..f4e7013 100644
--- a/notebook/_version.py
+++ b/notebook/_version.py
@@ -9,5 +9,5 @@ store the current version info of the notebook.
 
 # Next beta/alpha/rc release: The version number for beta is X.Y.ZbN **without dots**. 
 
-version_info = (5, 1, 0)
+version_info = (5, 2, 1)
 __version__ = '.'.join(map(str, version_info[:3])) + ''.join(version_info[3:])
diff --git a/notebook/base/handlers.py b/notebook/base/handlers.py
index 76651e9..d5a7382 100755
--- a/notebook/base/handlers.py
+++ b/notebook/base/handlers.py
@@ -10,6 +10,8 @@ import os
 import re
 import sys
 import traceback
+import types
+import warnings
 try:
     # py3
     from http.client import responses
@@ -102,6 +104,9 @@ class AuthenticatedHandler(web.RequestHandler):
         For example: in the default LoginHandler, if a request is token-authenticated,
         origin checking should be skipped.
         """
+        if self.request.method == 'OPTIONS':
+            # no origin-check on options requests, which are used to check origins!
+            return True
         if self.login_handler is None or not hasattr(self.login_handler, 'should_check_origin'):
             return False
         return not self.login_handler.should_check_origin(self)
@@ -279,6 +284,20 @@ class IPythonHandler(AuthenticatedHandler):
         if self.allow_credentials:
             self.set_header("Access-Control-Allow-Credentials", 'true')
     
+    def set_attachment_header(self, filename):
+        """Set Content-Disposition: attachment header
+
+        As a method to ensure handling of filename encoding
+        """
+        escaped_filename = url_escape(filename)
+        self.set_header('Content-Disposition',
+            'attachment;'
+            " filename*=utf-8''{utf8}"
+            .format(
+                utf8=escaped_filename,
+            )
+        )
+
     def get_origin(self):
         # Handle WebSocket Origin naming convention differences
         # The difference between version 8 and 13 is that in 8 the
@@ -436,6 +455,40 @@ class APIHandler(IPythonHandler):
             raise web.HTTPError(404)
         return super(APIHandler, self).prepare()
 
+    def write_error(self, status_code, **kwargs):
+        """APIHandler errors are JSON, not human pages"""
+        self.set_header('Content-Type', 'application/json')
+        message = responses.get(status_code, 'Unknown HTTP Error')
+        reply = {
+            'message': message,
+        }
+        exc_info = kwargs.get('exc_info')
+        if exc_info:
+            e = exc_info[1]
+            if isinstance(e, HTTPError):
+                reply['message'] = e.log_message or message
+            else:
+                reply['message'] = 'Unhandled error'
+                reply['traceback'] = ''.join(traceback.format_exception(*exc_info))
+        self.log.warning(reply['message'])
+        self.finish(json.dumps(reply))
+
+    def get_current_user(self):
+        """Raise 403 on API handlers instead of redirecting to human login page"""
+        # preserve _user_cache so we don't raise more than once
+        if hasattr(self, '_user_cache'):
+            return self._user_cache
+        self._user_cache = user = super(APIHandler, self).get_current_user()
+        return user
+
+    def get_login_url(self):
+        # if get_login_url is invoked in an API handler,
+        # that means @web.authenticated is trying to trigger a redirect.
+        # instead of redirecting, raise 403 instead.
+        if not self.current_user:
+            raise web.HTTPError(403)
+        return super(APIHandler, self).get_login_url()
+
     @property
     def content_security_policy(self):
         csp = '; '.join([
@@ -450,7 +503,7 @@ class APIHandler(IPythonHandler):
     def update_api_activity(self):
         """Update last_activity of API requests"""
         # record activity of authenticated requests
-        if self._track_activity and self.get_current_user():
+        if self._track_activity and getattr(self, '_user_cache', None):
             self.settings['api_last_activity'] = utcnow()
 
     def finish(self, *args, **kwargs):
@@ -459,10 +512,10 @@ class APIHandler(IPythonHandler):
         return super(APIHandler, self).finish(*args, **kwargs)
 
     def options(self, *args, **kwargs):
-        self.set_header('Access-Control-Allow-Headers', 'accept, content-type, authorization')
+        self.set_header('Access-Control-Allow-Headers',
+                        'accept, content-type, authorization, x-xsrftoken')
         self.set_header('Access-Control-Allow-Methods',
                         'GET, PUT, POST, PATCH, DELETE, OPTIONS')
-        self.finish()
 
 
 class Template404(IPythonHandler):
@@ -478,7 +531,7 @@ class AuthenticatedFileHandler(IPythonHandler, web.StaticFileHandler):
     def get(self, path):
         if os.path.splitext(path)[1] == '.ipynb' or self.get_argument("download", False):
             name = path.rsplit('/', 1)[-1]
-            self.set_header('Content-Disposition','attachment; filename="%s"' % escape.url_escape(name))
+            self.set_attachment_header(name)
 
         return web.StaticFileHandler.get(self, path)
     
@@ -533,32 +586,14 @@ def json_errors(method):
     2. Create and return a JSON body with a message field describing
        the error in a human readable form.
     """
+    warnings.warn('@json_errors is deprecated in notebook 5.2.0. Subclass APIHandler instead.',
+        DeprecationWarning,
+        stacklevel=2,
+    )
     @functools.wraps(method)
-    @gen.coroutine
     def wrapper(self, *args, **kwargs):
-        try:
-            result = yield gen.maybe_future(method(self, *args, **kwargs))
-        except web.HTTPError as e:
-            self.set_header('Content-Type', 'application/json')
-            status = e.status_code
-            message = e.log_message
-            self.log.warning(message)
-            self.set_status(e.status_code)
-            reply = dict(message=message, reason=e.reason)
-            self.finish(json.dumps(reply))
-        except Exception:
-            self.set_header('Content-Type', 'application/json')
-            self.log.error("Unhandled error in API request", exc_info=True)
-            status = 500
-            message = "Unknown server error"
-            t, value, tb = sys.exc_info()
-            self.set_status(status)
-            tb_text = ''.join(traceback.format_exception(t, value, tb))
-            reply = dict(message=message, reason=None, traceback=tb_text)
-            self.finish(json.dumps(reply))
-        else:
-            # FIXME: can use regular return in generators in py3
-            raise gen.Return(result)
+        self.write_error = types.MethodType(APIHandler.write_error, self)
+        return method(self, *args, **kwargs)
     return wrapper
 
 
@@ -629,7 +664,6 @@ class FileFindHandler(IPythonHandler, web.StaticFileHandler):
 
 class APIVersionHandler(APIHandler):
 
-    @json_errors
     def get(self):
         # not authenticated, so give as few info as possible
         self.finish(json.dumps({"version":notebook.__version__}))
diff --git a/notebook/bundler/tarball_bundler.py b/notebook/bundler/tarball_bundler.py
index e513dbf..854ab67 100644
--- a/notebook/bundler/tarball_bundler.py
+++ b/notebook/bundler/tarball_bundler.py
@@ -39,10 +39,9 @@ def bundle(handler, model):
     with io.BytesIO() as tar_buffer:
         with tarfile.open(tar_filename, "w:gz", fileobj=tar_buffer) as tar:
             tar.addfile(info, io.BytesIO(notebook_content))
-        
-        handler.set_header('Content-Disposition',
-                           'attachment; filename="{}"'.format(tar_filename))
+
+        handler.set_attachment_header(tar_filename)
         handler.set_header('Content-Type', 'application/gzip')
-                
+
         # Return the buffer value as the response
         handler.finish(tar_buffer.getvalue())
diff --git a/notebook/bundler/zip_bundler.py b/notebook/bundler/zip_bundler.py
index 2fd228a..f7bd5cc 100644
--- a/notebook/bundler/zip_bundler.py
+++ b/notebook/bundler/zip_bundler.py
@@ -35,8 +35,7 @@ def bundle(handler, model):
 
     # Headers
     zip_filename = os.path.splitext(notebook_name)[0] + '.zip'
-    handler.set_header('Content-Disposition',
-                       'attachment; filename="%s"' % zip_filename)
+    handler.set_attachment_header(zip_filename)
     handler.set_header('Content-Type', 'application/zip')
 
     # Get associated files
diff --git a/notebook/files/handlers.py b/notebook/files/handlers.py
index 4eaeb03..3f9fea1 100644
--- a/notebook/files/handlers.py
+++ b/notebook/files/handlers.py
@@ -12,12 +12,19 @@ except ImportError: #PY2
     from base64 import decodestring as decodebytes
 
 
-from tornado import web, escape
+from tornado import web
 
 from notebook.base.handlers import IPythonHandler
 
+
 class FilesHandler(IPythonHandler):
-    """serve files via ContentsManager"""
+    """serve files via ContentsManager
+
+    Normally used when ContentsManager is not a FileContentsManager.
+
+    FileContentsManager subclasses use AuthenticatedFilesHandler by default,
+    a subclass of StaticFileHandler.
+    """
 
     @web.authenticated
     def head(self, path):
@@ -27,16 +34,10 @@ class FilesHandler(IPythonHandler):
     def get(self, path, include_body=True):
         cm = self.contents_manager
 
-        if cm.files_handler_class:
-            return cm.files_handler_class(self.application, self.request, path=cm.root_dir)._execute(
-                [t(self.request) for t in self.application.transforms],
-                path
-            )
-
         if cm.is_hidden(path):
             self.log.info("Refusing to serve hidden file, via 404 Error")
             raise web.HTTPError(404)
-        
+
         path = path.strip('/')
         if '/' in path:
             _, name = path.rsplit('/', 1)
@@ -46,7 +47,7 @@ class FilesHandler(IPythonHandler):
         model = cm.get(path, type='file', content=include_body)
         
         if self.get_argument("download", False):
-            self.set_header('Content-Disposition','attachment; filename="%s"' % escape.url_escape(name))
+            self.set_attachment_header(name)
         
         # get mimetype from filename
         if name.endswith('.ipynb'):
@@ -73,6 +74,5 @@ class FilesHandler(IPythonHandler):
                 self.write(model['content'])
             self.flush()
 
-default_handlers = [
-    (r"/files/(.*)", FilesHandler),
-]
+
+default_handlers = []
diff --git a/notebook/i18n/nbjs.json b/notebook/i18n/nbjs.json
index d12cecd..fd1a970 100644
--- a/notebook/i18n/nbjs.json
+++ b/notebook/i18n/nbjs.json
@@ -1,6 +1,7 @@
 {
 	"domain": "nbjs",
 	"supported_languages": [
+		"zh-CN"
 	],
 	"locale_data": {
 		"nbjs": {
diff --git a/notebook/i18n/zh-CN/LC_MESSAGES/nbjs.po b/notebook/i18n/zh-CN/LC_MESSAGES/nbjs.po
new file mode 100644
index 0000000..7e44990
--- /dev/null
+++ b/notebook/i18n/zh-CN/LC_MESSAGES/nbjs.po
@@ -0,0 +1,2334 @@
+# Translations template for Jupyter.
+# Copyright (C) 2017 ORGANIZATION
+# This file is distributed under the same license as the Jupyter project.
+# FIRST AUTHOR <EMAIL at ADDRESS>, 2017.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: Jupyter VERSION\n"
+"Report-Msgid-Bugs-To: EMAIL at ADDRESS\n"
+"POT-Creation-Date: 2017-08-25 02:53-0400\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
+"Language-Team: LANGUAGE <LL at li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 2.5.0\n"
+
+#: notebook/static/base/js/dialog.js:161
+msgid "Manually edit the JSON below to manipulate the metadata for this cell."
+msgstr "手动编辑下面的JSON代码来修改块元数据."
+
+#: notebook/static/base/js/dialog.js:163
+msgid "Manually edit the JSON below to manipulate the metadata for this notebook."
+msgstr "手动编辑下面的JSON代码来修改界面元数据."
+
+#: notebook/static/base/js/dialog.js:165
+msgid " We recommend putting custom metadata attributes in an appropriately named substructure, so they don't conflict with those of others."
+msgstr "我们建议将自定义的元数据属性放入适当的子结构中,这样就不会与其他的子结构发生冲突."
+
+#: notebook/static/base/js/dialog.js:180
+msgid "Edit the metadata"
+msgstr "编辑元数据"
+
+#: notebook/static/base/js/dialog.js:202
+msgid "Edit Notebook Metadata"
+msgstr "编辑界面元数据"
+
+#: notebook/static/base/js/dialog.js:204
+msgid "Edit Cell Metadata"
+msgstr "编辑块元数据"
+
+#: notebook/static/base/js/dialog.js:208
+#: notebook/static/notebook/js/notebook.js:485
+#: notebook/static/notebook/js/savewidget.js:71
+#: notebook/static/tree/js/notebooklist.js:863
+#: notebook/static/tree/js/notebooklist.js:1420
+msgid "Cancel"
+msgstr "取消"
+
+#: notebook/static/base/js/dialog.js:208
+msgid "Edit"
+msgstr "编辑"
+
+#: notebook/static/base/js/dialog.js:208
+#: notebook/static/notebook/js/kernelselector.js:278
+#: notebook/static/notebook/js/mathjaxutils.js:42
+#: notebook/static/notebook/js/notebook.js:479
+#: notebook/static/notebook/js/notificationarea.js:186
+#: notebook/static/notebook/js/savewidget.js:71
+#: notebook/static/tree/js/newnotebook.js:97
+#: notebook/static/tree/js/notebooklist.js:863
+msgid "OK"
+msgstr "确定"
+
+#: notebook/static/base/js/dialog.js:208
+msgid "Apply"
+msgstr "应用"
+
+#: notebook/static/base/js/dialog.js:225
+msgid "WARNING: Could not save invalid JSON."
+msgstr "警告: 不能保存无效的JSON."
+
+#: notebook/static/base/js/dialog.js:247
+msgid "There are no attachments for this cell."
+msgstr "这个块没有附件."
+
+#: notebook/static/base/js/dialog.js:250
+msgid "Current cell attachments"
+msgstr "当前块附件"
+
+#: notebook/static/base/js/dialog.js:259
+#: notebook/static/notebook/js/celltoolbarpresets/attachments.js:46
+msgid "Attachments"
+msgstr "附件"
+
+#: notebook/static/base/js/dialog.js:283
+msgid "Restore"
+msgstr "重新保存"
+
+#: notebook/static/base/js/dialog.js:293
+#: notebook/static/tree/js/notebooklist.js:1022
+msgid "Delete"
+msgstr "删除"
+
+#: notebook/static/base/js/dialog.js:342 notebook/static/base/js/dialog.js:386
+msgid "Edit attachments"
+msgstr "编辑附件"
+
+#: notebook/static/base/js/dialog.js:348
+msgid "Edit Notebook Attachments"
+msgstr "编辑代码附件"
+
+#: notebook/static/base/js/dialog.js:350
+msgid "Edit Cell Attachments"
+msgstr "编辑块附件"
+
+#: notebook/static/base/js/dialog.js:373
+msgid "Select a file to insert."
+msgstr "选择文件插入"
+
+#: notebook/static/base/js/dialog.js:399
+msgid "Select a file"
+msgstr "选择文件"
+
+#: notebook/static/notebook/js/about.js:14
+msgid "You are using Jupyter notebook."
+msgstr "你正在运行notebook."
+
+#: notebook/static/notebook/js/about.js:16
+msgid "The version of the notebook server is: "
+msgstr "该notebook 服务的版本是:"
+
+#: notebook/static/notebook/js/about.js:22
+msgid "The server is running on this version of Python:"
+msgstr "该服务运行中使用的python版本为:"
+
+#: notebook/static/notebook/js/about.js:25
+msgid "Waiting for kernel to be available..."
+msgstr "等待服务可用..."
+
+#: notebook/static/notebook/js/about.js:27
+msgid "Server Information:"
+msgstr "服务信息:"
+
+#: notebook/static/notebook/js/about.js:29
+msgid "Current Kernel Information:"
+msgstr "当前服务信息:"
+
+#: notebook/static/notebook/js/about.js:32
+msgid "Could not access sys_info variable for version information."
+msgstr "无法为版本信息访问sysinfo变量."
+
+#: notebook/static/notebook/js/about.js:34
+msgid "Cannot find sys_info!"
+msgstr "找不到sys_info!"
+
+#: notebook/static/notebook/js/about.js:38
+msgid "About Jupyter Notebook"
+msgstr "关于 Jupyter Notebook"
+
+#: notebook/static/notebook/js/about.js:47
+msgid "unable to contact kernel"
+msgstr "不能连接到服务"
+
+#: notebook/static/notebook/js/actions.js:69
+msgid "toggle rtl layout"
+msgstr "切换trl布局"
+
+#: notebook/static/notebook/js/actions.js:70
+msgid "Toggle the screen directionality between left-to-right and right-to-left"
+msgstr "切换左右至右至左之间的屏幕方向"
+
+#: notebook/static/notebook/js/actions.js:76
+msgid "edit command mode keyboard shortcuts"
+msgstr "编辑命令模式快捷键"
+
+#: notebook/static/notebook/js/actions.js:77
+msgid "Open a dialog to edit the command mode keyboard shortcuts"
+msgstr "打开窗口来编辑快捷键"
+
+#: notebook/static/notebook/js/actions.js:97
+msgid "restart kernel"
+msgstr "重启服务"
+
+#: notebook/static/notebook/js/actions.js:98
+msgid "restart the kernel (no confirmation dialog)"
+msgstr "重启服务(没有确认窗口)"
+
+#: notebook/static/notebook/js/actions.js:106
+msgid "confirm restart kernel"
+msgstr "确定重启服务"
+
+#: notebook/static/notebook/js/actions.js:107
+msgid "restart the kernel (with dialog)"
+msgstr "重启服务(带窗口)"
+
+#: notebook/static/notebook/js/actions.js:113
+msgid "restart kernel and run all cells"
+msgstr "重启服务并且运行所有代码块"
+
+#: notebook/static/notebook/js/actions.js:114
+msgid "restart the kernel, then re-run the whole notebook (no confirmation dialog)"
+msgstr "重启服务, 然后重新运行整个代码(不含确认窗口)"
+
+#: notebook/static/notebook/js/actions.js:120
+msgid "confirm restart kernel and run all cells"
+msgstr "确认重启服务并且运行所有代码块"
+
+#: notebook/static/notebook/js/actions.js:121
+msgid "restart the kernel, then re-run the whole notebook (with dialog)"
+msgstr "重启服务, 然后重新运行整个代码(含窗口)"
+
+#: notebook/static/notebook/js/actions.js:127
+msgid "restart kernel and clear output"
+msgstr "重启服务并且清空输入"
+
+#: notebook/static/notebook/js/actions.js:128
+msgid "restart the kernel and clear all output (no confirmation dialog)"
+msgstr "重启服务并且清空所有输出(不含确认窗口)"
+
+#: notebook/static/notebook/js/actions.js:134
+msgid "confirm restart kernel and clear output"
+msgstr "确认重启服务并且清空输出"
+
+#: notebook/static/notebook/js/actions.js:135
+msgid "restart the kernel and clear all output (with dialog)"
+msgstr "重启服务并且清空所有输出(含窗口)"
+
+#: notebook/static/notebook/js/actions.js:142
+#: notebook/static/notebook/js/actions.js:143
+msgid "interrupt the kernel"
+msgstr "中断服务"
+
+#: notebook/static/notebook/js/actions.js:150
+msgid "run cell and select next"
+msgstr "运行代码块并且选择下一个代码块"
+
+#: notebook/static/notebook/js/actions.js:152
+msgid "run cell, select below"
+msgstr "运行代码块, 选择下面的代码块"
+
+#: notebook/static/notebook/js/actions.js:159
+#: notebook/static/notebook/js/actions.js:160
+msgid "run selected cells"
+msgstr "运行选中的代码块"
+
+#: notebook/static/notebook/js/actions.js:167
+#: notebook/static/notebook/js/actions.js:168
+msgid "run cell and insert below"
+msgstr "运行代码块并且插入下面"
+
+#: notebook/static/notebook/js/actions.js:175
+#: notebook/static/notebook/js/actions.js:176
+msgid "run all cells"
+msgstr "运行所有的代码块"
+
... 5547 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/jupyter-notebook.git



More information about the Python-modules-commits mailing list