Hello community,
here is the log from the commit of package jupyter-jupyterlab_templates for
openSUSE:Factory checked in at 2019-09-23 12:32:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/jupyter-jupyterlab_templates (Old)
and /work/SRC/openSUSE:Factory/.jupyter-jupyterlab_templates.new.7948
(New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "jupyter-jupyterlab_templates"
Mon Sep 23 12:32:09 2019 rev:3 rq:730779 version:0.2.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/jupyter-jupyterlab_templates/jupyter-jupyterlab_templates.changes
2019-06-04 12:13:03.531807658 +0200
+++
/work/SRC/openSUSE:Factory/.jupyter-jupyterlab_templates.new.7948/jupyter-jupyterlab_templates.changes
2019-09-23 12:32:13.713661182 +0200
@@ -1,0 +2,7 @@
+Sat Jul 27 23:24:10 UTC 2019 - Todd R <[email protected]>
+
+- Update to 0.2.0
+ * JupyterLab 1.0.0 support
+ * Will now scan standard locations for vendor notebooks
+
+-------------------------------------------------------------------
Old:
----
jupyterlab_templates-0.0.8.tar.gz
New:
----
jupyterlab_templates-0.2.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ jupyter-jupyterlab_templates.spec ++++++
--- /var/tmp/diff_new_pack.q7LYq0/_old 2019-09-23 12:32:14.721661016 +0200
+++ /var/tmp/diff_new_pack.q7LYq0/_new 2019-09-23 12:32:14.725661015 +0200
@@ -17,7 +17,7 @@
Name: jupyter-jupyterlab_templates
-Version: 0.0.8
+Version: 0.2.0
Release: 0
Summary: Templates for notebooks in JupyterLab
License: Apache-2.0
@@ -27,13 +27,13 @@
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: python3-setuptools
-Requires: jupyter-jupyterlab
+Requires: jupyter-jupyterlab >= 1.0.0
Provides: python3-jupyter_jupyterlab_templates = %{version}
Obsoletes: python3-jupyter_jupyterlab_templates < %{version}
Provides: python3-jupyterlab_templates = %{version}
BuildArch: noarch
# SECTION test requirements
-BuildRequires: jupyter-jupyterlab
+BuildRequires: jupyter-jupyterlab >= 1.0.0
# /SECTION
%description
++++++ jupyterlab_templates-0.0.8.tar.gz -> jupyterlab_templates-0.2.0.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jupyterlab_templates-0.0.8/PKG-INFO
new/jupyterlab_templates-0.2.0/PKG-INFO
--- old/jupyterlab_templates-0.0.8/PKG-INFO 2019-04-26 17:13:55.000000000
+0200
+++ new/jupyterlab_templates-0.2.0/PKG-INFO 2019-06-30 07:07:41.000000000
+0200
@@ -1,12 +1,11 @@
Metadata-Version: 2.1
Name: jupyterlab_templates
-Version: 0.0.8
+Version: 0.2.0
Summary: Templates for notebooks in JupyterLab
Home-page: https://github.com/timkpaine/jupyterlab_templates
Author: Tim Paine
Author-email: [email protected]
License: Apache 2.0
-Download-URL:
https://github.com/timkpaine/jupyterlab_templates/archive/v0.0.8.tar.gz
Description: # jupyterlab_templates
Support for jupyter notebook templates in jupyterlab
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jupyterlab_templates-0.0.8/jupyterlab_templates/__init__.py
new/jupyterlab_templates-0.2.0/jupyterlab_templates/__init__.py
--- old/jupyterlab_templates-0.0.8/jupyterlab_templates/__init__.py
2019-04-26 17:10:25.000000000 +0200
+++ new/jupyterlab_templates-0.2.0/jupyterlab_templates/__init__.py
2019-06-29 17:36:45.000000000 +0200
@@ -1,4 +1,4 @@
-__version__ = '0.0.8'
+__version__ = '0.2.0'
def _jupyter_server_extension_paths():
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jupyterlab_templates-0.0.8/jupyterlab_templates/extension.py
new/jupyterlab_templates-0.2.0/jupyterlab_templates/extension.py
--- old/jupyterlab_templates-0.0.8/jupyterlab_templates/extension.py
2019-02-24 16:43:56.000000000 +0100
+++ new/jupyterlab_templates-0.2.0/jupyterlab_templates/extension.py
2019-06-29 21:09:52.000000000 +0200
@@ -1,6 +1,9 @@
import os
import os.path
+import fnmatch
import json
+import jupyter_core.paths
+from io import open
from notebook.base.handlers import IPythonHandler
from notebook.utils import url_path_join
@@ -9,8 +12,20 @@
def initialize(self, templates=None):
self.templates = templates
+ def get(self):
+ temp = self.get_argument('template', '')
+ if temp:
+ self.finish(self.templates[temp])
+ else:
+ self.set_status(404)
+
+
+class TemplateNamesHandler(IPythonHandler):
+ def initialize(self, templates=None):
+ self.templates = templates
+
def get(self, template=None):
- self.finish(json.dumps({'templates': self.templates}))
+ self.finish(json.dumps(sorted(self.templates.keys())))
def load_jupyter_server_extension(nb_server_app):
@@ -31,16 +46,24 @@
host_pattern = '.*$'
print('Installing jupyterlab_templates handler on path %s' %
url_path_join(base_url, 'templates'))
- template_dirs = nb_server_app.config.get('JupyterLabTemplates',
{}).get('template_dirs', [])
+ template_dirs.extend([os.path.join(x, 'notebook_templates') for x in
jupyter_core.paths.jupyter_path()])
+ print('Search paths:\n\t%s' % '\n\t'.join(template_dirs))
- templates = []
+ templates = {}
for path in template_dirs:
abspath = os.path.abspath(os.path.realpath(path))
- files = [f for f in os.listdir(abspath) if
os.path.isfile(os.path.join(abspath, f)) and f.endswith('.ipynb')]
- for f in files:
- with open(os.path.join(abspath, f), 'r') as fp:
+ files = []
+ # get all files in subdirectories
+ for dirname, dirnames, filenames in os.walk(path):
+ for filename in fnmatch.filter(filenames, '*.ipynb'):
+ files.append((os.path.join(dirname, filename),
dirname.replace(path, ''), filename))
+
+ # pull contents and push into templates list
+ for f, dirname, filename in files:
+ with open(os.path.join(abspath, f), 'r', encoding='utf8') as fp:
content = fp.read()
- templates.append((f, abspath, content))
+ templates[os.path.join(dirname, filename)] = {'path': f,
'dirname': dirname, 'filename': filename, 'content': content}
- print('Available templates: %s' % ','.join(t[0] for t in templates))
+ print('Available templates:\n\t%s' % '\n\t'.join(t for t in templates))
+ web_app.add_handlers(host_pattern, [(url_path_join(base_url,
'templates/names'), TemplateNamesHandler, {'templates': templates})])
web_app.add_handlers(host_pattern, [(url_path_join(base_url,
'templates/get'), TemplatesHandler, {'templates': templates})])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jupyterlab_templates-0.0.8/jupyterlab_templates/templates/Sample.ipynb
new/jupyterlab_templates-0.2.0/jupyterlab_templates/templates/Sample.ipynb
--- old/jupyterlab_templates-0.0.8/jupyterlab_templates/templates/Sample.ipynb
2018-03-18 00:12:22.000000000 +0100
+++ new/jupyterlab_templates-0.2.0/jupyterlab_templates/templates/Sample.ipynb
1970-01-01 01:00:00.000000000 +0100
@@ -1,70 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "# Sample Template"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Here is some sample text, and a first block of code"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 1,
- "metadata": {},
- "outputs": [],
- "source": [
- "# insert code here\n",
- "\n"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## A second heading"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "and some more text"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "Python 3",
- "language": "python",
- "name": "python3"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.6.4"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 2
-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jupyterlab_templates-0.0.8/jupyterlab_templates/templates/jupyterlab_templates/Sample.ipynb
new/jupyterlab_templates-0.2.0/jupyterlab_templates/templates/jupyterlab_templates/Sample.ipynb
---
old/jupyterlab_templates-0.0.8/jupyterlab_templates/templates/jupyterlab_templates/Sample.ipynb
1970-01-01 01:00:00.000000000 +0100
+++
new/jupyterlab_templates-0.2.0/jupyterlab_templates/templates/jupyterlab_templates/Sample.ipynb
2018-03-18 00:12:22.000000000 +0100
@@ -0,0 +1,70 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Sample Template"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Here is some sample text, and a first block of code"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# insert code here\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## A second heading"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "and some more text"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.6.4"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jupyterlab_templates-0.0.8/jupyterlab_templates.egg-info/PKG-INFO
new/jupyterlab_templates-0.2.0/jupyterlab_templates.egg-info/PKG-INFO
--- old/jupyterlab_templates-0.0.8/jupyterlab_templates.egg-info/PKG-INFO
2019-04-26 17:13:55.000000000 +0200
+++ new/jupyterlab_templates-0.2.0/jupyterlab_templates.egg-info/PKG-INFO
2019-06-30 07:07:41.000000000 +0200
@@ -1,12 +1,11 @@
Metadata-Version: 2.1
Name: jupyterlab-templates
-Version: 0.0.8
+Version: 0.2.0
Summary: Templates for notebooks in JupyterLab
Home-page: https://github.com/timkpaine/jupyterlab_templates
Author: Tim Paine
Author-email: [email protected]
License: Apache 2.0
-Download-URL:
https://github.com/timkpaine/jupyterlab_templates/archive/v0.0.8.tar.gz
Description: # jupyterlab_templates
Support for jupyter notebook templates in jupyterlab
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jupyterlab_templates-0.0.8/jupyterlab_templates.egg-info/SOURCES.txt
new/jupyterlab_templates-0.2.0/jupyterlab_templates.egg-info/SOURCES.txt
--- old/jupyterlab_templates-0.0.8/jupyterlab_templates.egg-info/SOURCES.txt
2019-04-26 17:13:55.000000000 +0200
+++ new/jupyterlab_templates-0.2.0/jupyterlab_templates.egg-info/SOURCES.txt
2019-06-30 07:07:41.000000000 +0200
@@ -11,4 +11,4 @@
jupyterlab_templates.egg-info/not-zip-safe
jupyterlab_templates.egg-info/requires.txt
jupyterlab_templates.egg-info/top_level.txt
-jupyterlab_templates/templates/Sample.ipynb
\ No newline at end of file
+jupyterlab_templates/templates/jupyterlab_templates/Sample.ipynb
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jupyterlab_templates-0.0.8/setup.py
new/jupyterlab_templates-0.2.0/setup.py
--- old/jupyterlab_templates-0.0.8/setup.py 2019-04-26 17:10:40.000000000
+0200
+++ new/jupyterlab_templates-0.2.0/setup.py 2019-06-29 17:36:57.000000000
+0200
@@ -12,11 +12,10 @@
setup(
name='jupyterlab_templates',
- version='0.0.8',
+ version='0.2.0',
description='Templates for notebooks in JupyterLab',
long_description=long_description,
url='https://github.com/timkpaine/jupyterlab_templates',
-
download_url='https://github.com/timkpaine/jupyterlab_templates/archive/v0.0.8.tar.gz',
author='Tim Paine',
author_email='[email protected]',
license='Apache 2.0',