Skip to content

Commit

Permalink
fixing documentation includes.
Browse files Browse the repository at this point in the history
  • Loading branch information
lwanger committed Aug 21, 2017
1 parent 443fda8 commit 9363e13
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 38 deletions.
17 changes: 8 additions & 9 deletions docs/cleaners.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Cleaners
Cleaner classes for cleaning input before conversion and validation.


Cleaners
--------
Creating Cleaners
-----------------

Cleaner classes inherit from the Cleaner metaclass. They must be callable, with the __call__ dunder
method taking one parameter, the value. An example of a cleaner to change the input value to lower
Expand All @@ -22,17 +22,16 @@ case looks like::
result = value.lower()
return result

Cleaners
--------


.. autoclass:: LowerCleaner
.. autoclass:: cooked_input.StripCleaner

.. autoclass:: cooked_input.LowerCleaner

.. autoclass:: UpperCleaner

.. autoclass:: CapitalizeCleaner
.. autoclass:: cooked_input.UpperCleaner

.. autoclass:: StripCleaner
.. autoclass:: cooked_input.CapitalizeCleaner

.. autoclass:: ReplaceCleaner
.. autoclass:: cooked_input.ReplaceCleaner

21 changes: 12 additions & 9 deletions docs/convertors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Convertors classes for converting the string input to the desired output. Conver
validation.


Convertors
----------
Creating Convertors
-------------------

Convertor classes inherit from the Convertor metaclass. They must be callable, with the __call__ dunder
method taking one parameter, the value. An example of a convertor to change the input value to an integer
Expand All @@ -28,18 +28,21 @@ looks like::
def __repr__(self):
return 'IntConvertor(base=%d, value_error_str=%s)' % (self._base, self.value_error_str)

.. autoclass:: IntConvertor
Convertors
----------

.. autoclass:: cooked_input.IntConvertor

.. autoclass:: FloatConvertor
.. autoclass:: cooked_input.FloatConvertor

.. autoclass:: BooleanConvertor
.. autoclass:: cooked_input.BooleanConvertor

.. autoclass:: ListConvertor
.. autoclass:: cooked_input.ListConvertor

.. autoclass:: DateConvertor
.. autoclass:: cooked_input.DateConvertor

.. autoclass:: YesNoConvertor
.. autoclass:: cooked_input.YesNoConvertor

.. autoclass:: TableConvertor
.. autoclass:: cooked_input.TableConvertor


1 change: 0 additions & 1 deletion docs/get_input.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ get_table_input
validate
--------


.. autofunction:: cooked_input.validate

process_value
Expand Down
33 changes: 14 additions & 19 deletions docs/validators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,19 @@ for more information on validus see: https://github.com/shopnilsazal/validus



Validators
----------
Creating Validators
-------------------

Validator classes inherit from the Validator metaclass. They must be callable, with the __call__ dunder
method taking one parameter, the value. An example of a validator to verify that the input is exactly
a specified length looks like::

class ExactLengthValidator(Validator):
# check a value is exactly a length
def __init__(self, length=None, **kwargs):
self._length = length
super(ExactLengthValidator, self).__init__(**kwargs)

def __call__(self, value):
# TypeError thrown if value does not implement __len__
val_len = len(value)
condition1 = (self._length is None or val_len == self._length)
return True if condition1 else False
Expand All @@ -39,28 +37,25 @@ a specified length looks like::
return 'ExactLengthValidator(value=%s)' % (self._length)


.. autoclass:: ExactLengthValidator

.. autoclass:: InLengthValidator

.. autoclass:: ExactValueValidator
Validators
----------

.. autoclass:: InRangeValidator
.. autoclass:: cooked_input.ExactLengthValidator

.. autoclass:: InChoicesValidator
.. autoclass:: cooked_input.InLengthValidator

.. autoclass:: NotInValidator
.. autoclass:: cooked_input.ExactValueValidator

.. autoclass:: InAnyValidator
.. autoclass:: cooked_input.InRangeValidator

.. autoclass:: RegexValidator
.. autoclass:: cooked_input.InChoicesValidator

.. autoclass:: PasswordValidator
.. autoclass:: cooked_input.NotInValidator

.. autoclass:: ListValidator
.. autoclass:: cooked_input.InAnyValidator

helper functions:
-----------------
.. autoclass:: cooked_input.RegexValidator

.. autofunction:: validate
.. autoclass:: cooked_input.PasswordValidator

.. autoclass:: cooked_input.ListValidator

0 comments on commit 9363e13

Please sign in to comment.