From b0b24795b24ee6809397fbbadf42f31f310a219f Mon Sep 17 00:00:00 2001 From: Agustin Henze Date: Wed, 8 Jul 2015 07:35:02 -0300 Subject: Imported Upstream version 7.6.0 --- scripts/generate_conf.py | 9 ++++++++ scripts/getwheelhouse.sh | 2 ++ scripts/github-release.py | 19 ++++++++++++++++ scripts/jinjify.py | 18 +++++++++------ scripts/set_version.py | 16 ++++++++++--- scripts/update-bower.sh | 57 +++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 111 insertions(+), 10 deletions(-) create mode 100755 scripts/generate_conf.py create mode 100755 scripts/github-release.py create mode 100755 scripts/update-bower.sh (limited to 'scripts') diff --git a/scripts/generate_conf.py b/scripts/generate_conf.py new file mode 100755 index 0000000..37a3a94 --- /dev/null +++ b/scripts/generate_conf.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python +# Generate a conf.py file from the template, using default settings. + +import nikola.plugins.command.init + +try: + print(nikola.plugins.command.init.CommandInit.create_configuration_to_string()) +except: + print(nikola.plugins.command.init.CommandInit.create_configuration_to_string().encode('utf-8')) diff --git a/scripts/getwheelhouse.sh b/scripts/getwheelhouse.sh index 911ffbd..753fc2b 100755 --- a/scripts/getwheelhouse.sh +++ b/scripts/getwheelhouse.sh @@ -3,5 +3,7 @@ for i in $@; do wget https://github.com/getnikola/wheelhouse/archive/v$i'.zip' unzip 'v'$i'.zip' pip install --use-wheel --no-index --find-links=wheelhouse-$i lxml Pillow ipython + # Install Markdown for Python 2.6. + pip install --use-wheel --no-index --find-links=wheelhouse-$i Markdown || true rm -rf wheelhouse-$i 'v'$i'.zip' done diff --git a/scripts/github-release.py b/scripts/github-release.py new file mode 100755 index 0000000..8280fda --- /dev/null +++ b/scripts/github-release.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python +import subprocess +import sys +import os + +if not os.path.exists('.pypt/gh-token'): + print("To use this script, you must create a GitHub token first.") + print("Get a token here: https://github.com/settings/tokens") + print("Then, put it in a file named .pypt/gh-token") + exit(1) + +inpf = input if sys.version_info[0] == 3 else raw_input + +FILE = inpf("Markdown file to use: ") +BASEDIR = os.getcwd() +REPO = 'getnikola/nikola' +TAG = inpf("Tag name (usually vX.Y.Z): ") + +subprocess.call(['.pypt/ghrel', FILE, BASEDIR, REPO, TAG]) diff --git a/scripts/jinjify.py b/scripts/jinjify.py index be69731..30f8029 100755 --- a/scripts/jinjify.py +++ b/scripts/jinjify.py @@ -22,6 +22,7 @@ dumb_replacements = [ ] dumber_replacements = [ + ['<%! import json %>\n\n', ''], [" {1}".format(version, os.path.join('docs', 'man', 'nikola.1'))) + sed_like_thing(':Version: .*', ':Version: Nikola v{0}'.format(version), os.path.join('docs', 'man', 'nikola.rst')) + man = subprocess.check_output(["rst2man", os.path.join('docs', 'man', 'nikola.rst')]) + with io.open(os.path.join('docs', 'man', 'nikola.1'), 'w', encoding='utf-8') as fh: + try: + man = man.decode('utf-8') + except AttributeError: + pass + fh.write(man) + subprocess.call(["gzip", "-f", os.path.join('docs', 'man', 'nikola.1')]) diff --git a/scripts/update-bower.sh b/scripts/update-bower.sh new file mode 100755 index 0000000..d077434 --- /dev/null +++ b/scripts/update-bower.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +# Update all bower packages +bower update + +# Link bootstrap3 theme to bootstrap +pushd nikola/data/themes/bootstrap3/assets/js/ +ln -sf ../../../../../../bower_components/bootstrap/dist/js/*js . +rm npm.js +git add . +popd + +pushd nikola/data/themes/bootstrap3/assets/css/ +ln -sf ../../../../../../bower_components/bootstrap/dist/css/* . +git add . +popd + +pushd nikola/data/themes/bootstrap3/assets/fonts/ +ln -sf ../../../../../../bower_components/bootstrap/dist/fonts/* . +git add . +popd + +# Link moment.js to base theme +pushd nikola/data/themes/base/assets/js +ln -sf ../../../../../../bower_components/moment/min/moment-with-locales.min.js . +git add moment-with-locales.min.js +popd + +# Link jQuery to bootstrap theme +pushd nikola/data/themes/bootstrap/assets/js +ln -sf ../../../../../../bower_components/jquery/dist/* . +git add . +popd + + +# Link colorbox into bootstrap theme +pushd nikola/data/themes/bootstrap/assets/js +ln -sf ../../../../../../bower_components/jquery-colorbox/jquery.colorbox.js . +git add jquery.colorbox.js +popd + +pushd nikola/data/themes/bootstrap/assets/js/colorbox-i18n +ln -sf ../../../../../../../bower_components/jquery-colorbox/i18n/* . +git add . +popd + +pushd nikola/data/themes/bootstrap/assets/css/ +ln -sf ../../../../../../bower_components/jquery-colorbox/example3/colorbox.css . +git add colorbox.css +popd + +pushd nikola/data/themes/bootstrap/assets/css/images/ +ln -sf ../../../../../../../bower_components/jquery-colorbox/example3/images/* . +git add . +popd + +scripts/generate_symlinked_list.sh -- cgit v1.2.3