Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
af844cb
Updated docs.
sys-git Sep 9, 2017
f528833
Merge branch 'master' of https://github.com/sys-git/hoft
sys-git Sep 9, 2017
9d65d31
Update nose-parameterized from 0.5.0 to 0.6.0
pyup-bot Sep 13, 2017
f402b57
Pin pylint to latest version 1.7.2
pyup-bot Sep 13, 2017
a99b9e0
Pin pytest to latest version 3.2.2
pyup-bot Sep 13, 2017
29c2df8
Update tox from 2.7.0 to 2.8.2
pyup-bot Sep 13, 2017
0cf59b0
Pin vulture to latest version 0.26
pyup-bot Sep 13, 2017
f57c908
Pin radon to latest version 2.1.1
pyup-bot Sep 13, 2017
01f30df
Merge pull request #1 from sys-git/pyup-initial-update
sys-git Sep 13, 2017
7b5359b
Added pyup badges
sys-git Sep 13, 2017
ff8dce8
Added pyup to index.rst
sys-git Sep 13, 2017
9815d11
Update six from 1.10.0 to 1.11.0
pyup-bot Sep 17, 2017
ade9d8e
Update six from 1.10.0 to 1.11.0
pyup-bot Sep 17, 2017
a5846a2
Updated docs.
francishorsman Sep 18, 2017
7f180f5
Merge branch 'master' of https://github.com/sys-git/hoft
francishorsman Sep 18, 2017
cd23bb2
Bumped version to 0.4.3
francishorsman Sep 18, 2017
73becda
Merge pull request #2 from sys-git/pyup-update-six-1.10.0-to-1.11.0
francishorsman Sep 18, 2017
c160584
Update sphinx from 1.6.3 to 1.6.4
pyup-bot Sep 26, 2017
b52a1df
Update tox from 2.8.2 to 2.9.1
pyup-bot Sep 30, 2017
7fc95fe
Update pylint from 1.7.2 to 1.7.4
pyup-bot Sep 30, 2017
c86e16c
Merge pull request #3 from sys-git/pyup-update-sphinx-1.6.3-to-1.6.4
sys-git Oct 3, 2017
bc90261
Merge pull request #6 from sys-git/pyup-update-tox-2.8.2-to-2.9.1
sys-git Oct 3, 2017
8682692
Merge pull request #7 from sys-git/pyup-update-pylint-1.7.2-to-1.7.4
sys-git Oct 3, 2017
bb34070
Update pytest from 3.2.2 to 3.2.3
pyup-bot Oct 5, 2017
4ce3501
Update sphinx from 1.6.4 to 1.6.5
pyup-bot Oct 23, 2017
3c92b28
Merge pull request #9 from sys-git/pyup-update-sphinx-1.6.4-to-1.6.5
sys-git Oct 23, 2017
a59bd3f
Merge pull request #8 from sys-git/pyup-update-pytest-3.2.2-to-3.2.3
sys-git Oct 25, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
[![PyPI](https://img.shields.io/pypi/wheel/hoft.svg)]()
[![PyPI](https://img.shields.io/pypi/pyversions/hoft.svg)]()
[![PyPI](https://img.shields.io/pypi/status/hoft.svg)]()
[![Updates](https://pyup.io/repos/github/sys-git/hoft/shield.svg)](https://pyup.io/repos/github/sys-git/hoft/)
[![Python 3](https://pyup.io/repos/github/sys-git/hoft/python-3-shield.svg)](https://pyup.io/repos/github/sys-git/hoft/)

Decorators that can be used to analyse a function's positional, keyword and default arguments.

Expand All @@ -25,21 +27,22 @@ Complete documentation can be found at <a href="http://hoft.readthedocs.io/en/la

<h3>Use case</h3>

1. Used in conjunction with a parameter checking and validation library to perform parameter validation prior to function execution.
1. Used in conjunction with a parameter checking and certification library to perform parameter
certification prior to function execution.

```
from hoft import analyse_sig, IGNORE
from validation_lib import validate_int, validate_string
from certifiable import certify_int, certify_string
...

@analyse_sig(validate_int(min_value=-100, max_value=100), IGNORE, c=IGNORE, d=validate_string(max_length=2))
@analyse_sig(certify_int(min_value=-100, max_value=100), IGNORE, c=IGNORE, d=certify_string(max_length=2))
def my_function(a, b, c=None, d=None, e='world'):
...

>>> my_function(-256, 'x', 'y', 'abcd')
Traceback (most recent call last):
...
validation_lib_error: .....
CertifierError: .....
```

<h3>Simple example</h3>
Expand Down
Binary file added docs/source/_static/forkme_right_red_aa0000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions docs/source/_templates/donate.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{% if theme_gratipay_user or theme_gittip_user %}
<h3>Donate</h3>
<p>
<b>Consider supporting the authors:</b>
<script data-gratipay-username="{{ theme_gratipay_user or theme_gittip_user }}"
data-gratipay-widget="button"
src="//gttp.co/v1.js"></script>
</p>
<p>
<script src="http://coinwidget.com/widget/coin.js"></script>
<script>
CoinWidgetCom.go({
wallet_address : '13vS6cvzZXf1Yxrar2SYSPQrFLSEwLePV4',
currency : 'bitcoin',
counter : 'amount',
lbl_button : 'Gratitudes',
lbl_count : 'payments',
lbl_amount : 'coins',
lbl_address : 'Please send bitcoin to:',
qrcode : true,
decimals : 0,
});
</script>
</p>
<p>
<script src="http://coinwidget.com/widget/coin.js"></script>
<script>
CoinWidgetCom.go({
wallet_address : 'LT636SrauWAz9XDz2EKxAXQ5jKqehyhR69',
currency : 'litecoin',
counter : 'amount',
lbl_button : 'Gratitudes',
lbl_count : 'payments',
lbl_amount : 'coins',
lbl_address : 'Please send litecoin to:',
qrcode : true,
decimals : 0,
});
</script>
</p>
<br>
{% endif %}
10 changes: 7 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@
# built documents.
#
# The short X.Y version.
version = u'0.1'
version = u'0.4.1'
# The full version, including alpha/beta/rc tags.
release = u'0.1'
release = u'0.4.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -98,9 +98,12 @@
'github_user': 'sys-git',
'github_repo': 'hoft',
'github_button': True,
'github_banner': True,
'github_banner': 'forkme_right_red_aa0000.png',
'show_powered_by': False,
'page_width': '1280px',
'analytics_id': 'UA-57353891-3',
'gratipay_user': 'algos and tools',
'travis_button': True,
}

html_show_sourcelink = True
Expand All @@ -120,6 +123,7 @@
'**': [
'sidebarintro.html',
'sidebarlogo.html',
'donate.html',
'searchbox.html'
],
}
Expand Down
13 changes: 9 additions & 4 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ HOFT - Higher Order Func Tools for Python2.7
:target: https://img.shields.io/pypi/pyversions/hoft.svg
.. image:: https://img.shields.io/pypi/status/hoft.svg
:target: https://img.shields.io/pypi/status/hoft.svg

.. image:: https://pyup.io/repos/github/sys-git/hoft/shield.svg
:target: https://pyup.io/repos/github/sys-git/hoft/
:alt: Updates
.. image:: https://pyup.io/repos/github/sys-git/hoft/python-3-shield.svg
:target: https://pyup.io/repos/github/sys-git/hoft/

.. toctree::
:maxdepth: 2
:caption: Contents:
Expand All @@ -41,17 +46,17 @@ Use case
.. code-block:: python

from hoft import analyse_sig, IGNORE
from validation_lib import validate_int, validate_string
from certifiable import certify_int, certify_string
...

@analyse_sig(validate_int(min_value=-100, max_value=100), IGNORE, c=IGNORE, d=validate_string(max_length=2))
@analyse_sig(certify_int(min_value=-100, max_value=100), IGNORE, c=IGNORE, d=certify_string(max_length=2))
def my_function(a, b, c=None, d=None, e='world'):
...

>>> my_function(-256, 'x', 'y', 'abcd')
Traceback (most recent call last):
...
validation_lib_error: .....
CertifierError: .....

Simple example
--------------
Expand Down
4 changes: 2 additions & 2 deletions hoft/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

__title__ = 'hoft'
__description__ = 'Higher Order Func Tools for Python2.7.'
__url__ = 'https://github.com/sys-git/hoft'
__version__ = '0.4.1'
__url__ = 'http://hoft.readthedocs.io/en/latest/'
__version__ = '0.4.3'
__author__ = 'Francis Horsman'
__author_email__ = 'francis.horsman@gmail.com'
__license__ = 'MIT'
Expand Down
16 changes: 8 additions & 8 deletions requirements/requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ nose==1.3.7
nose-progressive==1.5.1
nose-cov==1.6
nose-leak-detector==0.1.5
nose-parameterized==0.5.0
nose-parameterized==0.6.0
nose-exclude==0.5.0
pylint
pytest
six==1.10.0
tox==2.7.0
vulture
radon
sphinx==1.6.3
pylint==1.7.4
pytest==3.2.3
six==1.11.0
tox==2.9.1
vulture==0.26
radon==2.1.1
sphinx==1.6.5
2 changes: 1 addition & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
enum34==1.1.6
six==1.10.0
six==1.11.0