automated doc upload

This commit is contained in:
Travis CI 2015-08-25 10:14:41 +02:00
parent 0abaefeb1e
commit 662fb2032b
4 changed files with 37 additions and 46 deletions

View file

@ -48,6 +48,6 @@ script:
after_success:
- git config credential.helper "store --file=.git/credentials"
- echo "https://${GH_TOKEN}:@github.com" > .git/credentials
- if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then travis_retry conda install --yes sphinx; fi
- if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then pip install numpydoc; fi
- if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then python doc/deploy_ghpages.py; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.4 ]]; then travis_retry conda install --yes sphinx; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.4 ]]; then pip install numpydoc; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.4 ]]; then python doc/deploy_ghpages.py; fi

View file

@ -6,12 +6,3 @@ Install [numpydoc](https://pypi.python.org/pypi/numpydoc):
To compile the documentation, run
python setup.py build_sphinx
To upload the documentation to gh-pages, run
python setup.py commit_doc
or
python doc/commit_gh-pages.py

View file

@ -40,8 +40,8 @@ Prerequisites
after_success:
- git config credential.helper "store --file=.git/credentials"
- echo "https://${GH_TOKEN}:@github.com" > .git/credentials
- if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then pip install numpydoc sphinx; fi
- if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then python doc/deploy_ghpages.py; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.4 ]]; then pip install numpydoc sphinx; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.4 ]]; then python doc/deploy_ghpages.py; fi
"""
from __future__ import print_function
@ -77,4 +77,4 @@ except:
pass #nothing to do
else:
sp.check_output("git push --force --quiet origin gh-pages", shell=True)

View file

@ -158,38 +158,38 @@ class ProgressBar(object):
class ProgressBarExtended(ProgressBar):
"""
extends the ProgressBar such that
on can turn of the ProgressBar by giving an extra argument,
namely 'progress_bar_off' and set its value to 'True'.
further there will be an additional argument passed to the function
called 'progress_bar' which allows to stop the progress bar from
within the function. note that there will be an function signature error
if the function does not accept the extra argument 'progress_bar'. So a
general **kwargs at the end of the functions arguments will help.
That is also the reason why the extended version comes in an extra class
because it might otherwise break compatibility.
Example
-------
>>> import jobmanager as jm
>>> c = jm.progress.UnsignedIntValue(val=0)
>>> m = jm.progress.UnsignedIntValue(val=20)
extends the ProgressBar such that
>>> @jm.decorators.ProgressBarExtended # choose 'ProgressBarExtended'
>>> def my_func_kwargs(c, m, **kwargs): # simply add '**kwargs' here
>>> for i in range(m.value):
>>> c.value = i+1
>>> time.sleep(0.1)
>>> # same as when using ProgressBar
>>> my_func_kwargs(c, m)
>>> # a simple kwarg will switch the progressBar off
>>> my_func_kwargs(c, m, progress_bar_off=True)
on can turn of the ProgressBar by giving an extra argument,
namely 'progress_bar_off' and set its value to 'True'.
further there will be an additional argument passed to the function
called 'progress_bar' which allows to stop the progress bar from
within the function. note that there will be an function signature error
if the function does not accept the extra argument 'progress_bar'. So a
general **kwargs at the end of the functions arguments will help.
That is also the reason why the extended version comes in an extra class
because it might otherwise break compatibility.
Example
-------
>>> import jobmanager as jm
>>> c = jm.progress.UnsignedIntValue(val=0)
>>> m = jm.progress.UnsignedIntValue(val=20)
>>> @jm.decorators.ProgressBarExtended # choose 'ProgressBarExtended'
>>> def my_func_kwargs(c, m, **kwargs): # simply add '**kwargs' here
>>> for i in range(m.value):
>>> c.value = i+1
>>> time.sleep(0.1)
>>> # same as when using ProgressBar
>>> my_func_kwargs(c, m)
>>> # a simple kwarg will switch the progressBar off
>>> my_func_kwargs(c, m, progress_bar_off=True)
"""
def __call__(self, *args, **kwargs):
# Bind the args and kwds to the argument names of self.func