Skip to content

Commit

Permalink
Merge branch 'master' into logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Kwpolska committed Jul 5, 2015
2 parents e019b3a + b4d237f commit 5b7bce0
Show file tree
Hide file tree
Showing 257 changed files with 4,859 additions and 1,273 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
@@ -1,6 +1,6 @@
[run]
source = nikola
omit = /tmp/*, _*
omit = /tmp/*, _*, nikola/packages*, nikola/data*, nikola/winutils*
[report]
exclude_lines =
pragma: no cover
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -20,3 +20,6 @@ __pycache__/

# pyenv
.python-version

# GitHub token
.pypt/gh-token
110 changes: 110 additions & 0 deletions .pypt/ghrel
@@ -0,0 +1,110 @@
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Kw’s Release Tools/Python Project Template
# GitHub Release Creator
# Copyright © 2013-2015, Chris Warrick.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions, and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions, and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the author of this software nor the names of
# contributors to this software may be used to endorse or promote
# products derived from this software without specific prior written
# consent.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

"""
Create GitHub releases out of changelogs.
Usage: .pypt/commitlog FILE BASEDIR REPOSITORY TAG, where
FILE is the path to the file to use, which can be
a plain .md file or a CMFN file,
BASEDIR is the project directory,
REPOSITORY is the full GitHub repository name (user/repo),
TAG is the tag to write to.
All paths should be absolute.
"""

import argparse
import json
import re
import requests
import sys
from os.path import join as pjoin


def main():
"""ghrel main function."""
parser = argparse.ArgumentParser(
description="GitHub Release Creator "
"(part of Chris Warrick's Python Project Template)")
parser.add_argument('filename', metavar='FILE', nargs=1,
help='File to parse (Markdown or commitlog)')
parser.add_argument('basedir', metavar='BASEDIR', nargs=1,
help='Project directory (must contain .pypt/gh-token)')
parser.add_argument('repo', metavar='REPOSITORY', nargs=1,
help='GitHub repository (owner/repo)')
parser.add_argument('tag', metavar='TAG', nargs=1,
help='Tag to create release for (vX.Y.Z)')
args = parser.parse_args()
# nargs gets you lists, not strings
filename = args.filename[0]
basedir = args.basedir[0]
repo = args.repo[0]
tag = args.tag[0]

with open(pjoin(basedir, '.pypt', 'gh-token')) as fh:
token = fh.read().strip()

headers = {
'User-Agent': 'Kwpolska/python-project-template',
'Authorization': 'token ' + token,
}

with open(filename) as fh:
fdata = fh.read()
e = re.findall(
'#~ CHANGELOG MESSAGE START ~#\n(.*?)\n'
'#~ CHANGELOG MESSAGE END ~#',
fdata, flags=re.S)

if e:
# parse as a CMFN file, replace backticks (reST -> Markdown)
message = e[0].replace('``', '`')
else:
# parse as a plain Markdown file
message = fdata

r = requests.post(
'https://api.github.com/repos/{0}/releases'.format(repo),
data=json.dumps({'tag_name': tag, 'body': message}),
headers=headers)

if r.status_code == 201:
print("GitHub Release created: {0}".format(r.json()['html_url']))
else:
print("GitHub Release failed: {0}".format(r.text))
return 1

if __name__ == '__main__':
sys.exit(main())
67 changes: 67 additions & 0 deletions CHANGES.txt
Expand Up @@ -5,8 +5,75 @@ Features
--------

* Remove logging handlers (Issue #1797)
* Screen reader-friendly navbar collapses and dropdowns (Issue #1863)
* Modern reST stylesheets, based in part on Bootstrap 3 (Issue #1150)

Bugfixes
--------

* Surpress wincing when auto is aborted during rebuilding
* Show tags only from the current language on tag listing pages (Issue #1856)
* Remove gap between line numbers and code (Issue #1859)
* Fix spurious warnings about posts published in the future (Issue #1850)

New in v7.6.0
=============

Features
--------

* Translate ``Write your post here.`` to default language (Issue #1621)
* Enable ``PRETTY_URLS`` by default on new sites created by the wizard
(Issue #1838)
* Add ``-F``, ``--available-compilers`` option to ``nikola new_post``
and ``nikola new_page`` (Issue #1837)
* Add print CSS to all default themes (Issue #1817)
* Support other kernels for ipynb/Jupyter using
``nikola new_post -f ipynb@kernel`` (Issues #1774, #1834)
* Add distinct styling for the site footer in bootstrap3
* Bootstrap v3.3.5 (Issue #1828)
* Use ``watchdog`` in ``nikola auto`` (Issue #1810)
* Add redirection for tags in Wordpress importer (Issue #1168)
* Add support for ``html_tidy_withconfig`` to use a ``tidy5.conf`` file
(Issue #1795)
* Change default tidy5 filters not to drop empty elements (Issue #1795)
* Apply per-post filters via metadata (Issue #914)

Bugfixes
--------

* Nikola auto was broken in python 3 (Issue #1830)
* Read configuration when importing into an existing site (Issue #1823)
* Don’t crash on non-UTF-8 files during sitemap generation (Issue #1842)
* Unnecessary rebuilds of yearly archives (Issue #1833)
* Quietly ignore non-existent files in ``nikola check -l`` (Issue #1831)
* Don’t rebuild all tag or category pages when changing tag/category descriptions
* Fix crash in wordpress code importer (Issue #1819)
* Call correct command in ``nikola auto``

New in v7.5.1
=============

Features
--------

* Suggest misspelled commands (Issue #1807)
* New implementation of the ``nikola auto`` command
* ``requests`` is now required for all Nikola sites
* New ``nikola version --check`` option (Issue #1767)

Bugfixes
--------

* Support pure markdown posts in WP import (Issue #484)
* Make auto shutdown with ctrl-c (Issue #1811)
* Log properly in ``nikola auto`` (Issue #1812)
* Handle rare gettz failure (Issue #1806)
* Handle missing dependencies better in auto plugin (Issues #1803, #1809)
* IDNA mixing unicode/bytes in python 3 (Issue #1802)
* Cleaner splitting of metadata in onefile posts (Issue #973)
* It's markdown extra, not extras (Issue #1799)

New in v7.5.0
=============

Expand Down
3 changes: 2 additions & 1 deletion bower.json
Expand Up @@ -12,6 +12,7 @@
"bootstrap": "~3.3.4",
"jquery": "<2.0.0",
"jquery-colorbox": "~1.6.0",
"moment": "~2.10.3"
"moment": "~2.10.3",
"livereload-js": "~2.2.1"
}
}
18 changes: 7 additions & 11 deletions bower_components/bootstrap/.bower.json
@@ -1,7 +1,6 @@
{
"name": "bootstrap",
"description": "The most popular front-end framework for developing responsive, mobile first projects on the web.",
"version": "3.3.4",
"keywords": [
"css",
"js",
Expand All @@ -13,15 +12,11 @@
"web"
],
"homepage": "http://getbootstrap.com",
"license": "MIT",
"moduleType": "globals",
"main": [
"less/bootstrap.less",
"dist/css/bootstrap.css",
"dist/js/bootstrap.js",
"dist/fonts/glyphicons-halflings-regular.eot",
"dist/fonts/glyphicons-halflings-regular.svg",
"dist/fonts/glyphicons-halflings-regular.ttf",
"dist/fonts/glyphicons-halflings-regular.woff",
"dist/fonts/glyphicons-halflings-regular.woff2"
"dist/js/bootstrap.js"
],
"ignore": [
"/.*",
Expand All @@ -36,11 +31,12 @@
"dependencies": {
"jquery": ">= 1.9.1"
},
"_release": "3.3.4",
"version": "3.3.5",
"_release": "3.3.5",
"_resolution": {
"type": "version",
"tag": "v3.3.4",
"commit": "a10eb60bc0b07b747fa0c4ebd8821eb7307bd07f"
"tag": "v3.3.5",
"commit": "16b48259a62f576e52c903c476bd42b90ab22482"
},
"_source": "git://github.com/twbs/bootstrap.git",
"_target": "~3.3.4",
Expand Down
56 changes: 38 additions & 18 deletions bower_components/bootstrap/Gruntfile.js
Expand Up @@ -44,7 +44,7 @@ module.exports = function (grunt) {
banner: '/*!\n' +
' * Bootstrap v<%= pkg.version %> (<%= pkg.homepage %>)\n' +
' * Copyright 2011-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
' * Licensed under <%= pkg.license.type %> (<%= pkg.license.url %>)\n' +
' * Licensed under the <%= pkg.license %> license\n' +
' */\n',
jqueryCheck: configBridge.config.jqueryCheck.join('\n'),
jqueryVersionCheck: configBridge.config.jqueryVersionCheck.join('\n'),
Expand All @@ -63,7 +63,7 @@ module.exports = function (grunt) {
options: {
jshintrc: 'grunt/.jshintrc'
},
src: ['Gruntfile.js', 'grunt/*.js']
src: ['Gruntfile.js', 'package.js', 'grunt/*.js']
},
core: {
src: 'js/*.js'
Expand Down Expand Up @@ -126,6 +126,10 @@ module.exports = function (grunt) {

uglify: {
options: {
compress: {
warnings: false
},
mangle: true,
preserveComments: 'some'
},
core: {
Expand Down Expand Up @@ -191,7 +195,7 @@ module.exports = function (grunt) {
src: 'dist/css/<%= pkg.name %>-theme.css'
},
docs: {
src: ['docs/assets/css/anchor.css', 'docs/assets/css/src/docs.css']
src: ['docs/assets/css/src/docs.css']
},
examples: {
expand: true,
Expand Down Expand Up @@ -240,24 +244,12 @@ module.exports = function (grunt) {
docs: {
src: [
'docs/assets/css/src/pygments-manni.css',
'docs/assets/css/src/anchor.css',
'docs/assets/css/src/docs.css'

],
dest: 'docs/assets/css/docs.min.css'
}
},

usebanner: {
options: {
position: 'top',
banner: '<%= banner %>'
},
files: {
src: 'dist/css/*.css'
}
},

csscomb: {
options: {
config: 'less/.csscomb.json'
Expand Down Expand Up @@ -317,6 +309,26 @@ module.exports = function (grunt) {
}
},

htmlmin: {
dist: {
options: {
collapseWhitespace: true,
conservativeCollapse: true,
minifyCSS: true,
minifyJS: true,
removeAttributeQuotes: true,
removeComments: true
},
expand: true,
cwd: '_gh_pages',
dest: '_gh_pages',
src: [
'**/*.html',
'!examples/**/*.html'
]
}
},

jade: {
options: {
pretty: true,
Expand Down Expand Up @@ -346,7 +358,7 @@ module.exports = function (grunt) {
watch: {
src: {
files: '<%= jshint.core.src %>',
tasks: ['jshint:src', 'qunit', 'concat']
tasks: ['jshint:core', 'qunit', 'concat']
},
test: {
files: '<%= jshint.test.src %>',
Expand All @@ -365,6 +377,14 @@ module.exports = function (grunt) {
return old ? RegExp.quote(old) : old;
})(),
replacement: grunt.option('newver'),
exclude: [
'dist/fonts',
'docs/assets',
'fonts',
'js/tests/vendor',
'node_modules',
'test-infra'
],
recursive: true
}
},
Expand Down Expand Up @@ -455,7 +475,7 @@ module.exports = function (grunt) {

// CSS distribution task.
grunt.registerTask('less-compile', ['less:compileCore', 'less:compileTheme']);
grunt.registerTask('dist-css', ['less-compile', 'autoprefixer:core', 'autoprefixer:theme', 'usebanner', 'csscomb:dist', 'cssmin:minifyCore', 'cssmin:minifyTheme']);
grunt.registerTask('dist-css', ['less-compile', 'autoprefixer:core', 'autoprefixer:theme', 'csscomb:dist', 'cssmin:minifyCore', 'cssmin:minifyTheme']);

// Full distribution task.
grunt.registerTask('dist', ['clean:dist', 'dist-css', 'copy:fonts', 'dist-js']);
Expand Down Expand Up @@ -491,7 +511,7 @@ module.exports = function (grunt) {
grunt.registerTask('lint-docs-js', ['jshint:assets', 'jscs:assets']);
grunt.registerTask('docs', ['docs-css', 'lint-docs-css', 'docs-js', 'lint-docs-js', 'clean:docs', 'copy:docs', 'build-glyphicons-data', 'build-customizer']);

grunt.registerTask('prep-release', ['jekyll:github', 'compress']);
grunt.registerTask('prep-release', ['dist', 'docs', 'jekyll:github', 'htmlmin', 'compress']);

// Task for updating the cached npm packages used by the Travis build (which are controlled by test-infra/npm-shrinkwrap.json).
// This task should be run and the updated file should be committed whenever Bootstrap's dependencies change.
Expand Down

0 comments on commit 5b7bce0

Please sign in to comment.