Skip to content

Commit 431a53f

Browse files
committed
Fix doublecolon usage
1 parent 1c91565 commit 431a53f

11 files changed

Lines changed: 12 additions & 41 deletions

File tree

‎docs/index.rst‎

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ Apparently `some other guys have felt the same way`_.
1616
http://opensourcehacker.com/2011/07/07/generic-python-validation-frameworks/
1717

1818
Often I've had for example a case where I just wanted to check if given string
19-
is an email. With `validators` this use case becomes as easy as:
20-
21-
::
19+
is an email. With `validators` this use case becomes as easy as::
2220

2321
>>> import validators
2422

@@ -30,13 +28,10 @@ is an email. With `validators` this use case becomes as easy as:
3028
Installation
3129
============
3230

33-
34-
::
35-
31+
You can install ``validators`` using pip::
3632

3733
pip install validators
3834

39-
4035
Currently validators supports python versions 2.6, 2.7 and 3.3.
4136

4237

@@ -49,21 +44,14 @@ validate and possibly some additional key-value arguments. Each function returns
4944
fails.
5045

5146
ValidationFailure class implements __bool__ method so you can easily check if
52-
validation failed:
53-
54-
::
55-
47+
validation failed::
5648

5749
if not email('some_bogus_email@@@'):
5850
# Do something here
5951
pass
6052

61-
6253
ValidationFailure object also holds all the arguments passed to original
63-
function:
64-
65-
::
66-
54+
function::
6755

6856
result = number_range(3, min=5)
6957
if not result:
@@ -74,7 +62,6 @@ function:
7462
# 5
7563

7664

77-
7865
between
7966
-------
8067

‎validators/email.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@ def email(value, whitelist=None):
2929
email validator`_. Returns True on success and `:class:FailedValidation`
3030
when validation fails.
3131
32-
3332
Examples::
3433
35-
3634
>>> assert validators.email('someone@example.com')
3735
3836
>>> assert not validators.email('bogus@@')

‎validators/extremes.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class Min(object):
1313
Inspired by https://pypi.python.org/pypi/Extremes
1414
1515
Examples::
16+
1617
>>> import validators
1718
>>> import sys
1819
@@ -38,10 +39,8 @@ class Max(object):
3839
3940
Inspired by https://pypi.python.org/pypi/Extremes
4041
41-
4242
Examples::
4343
44-
4544
>>> import validators
4645
>>> import sys
4746

‎validators/i18n/fi.py‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def fi_business_id(business_id):
2525
.. _Finnish Trade Register:
2626
http://en.wikipedia.org/wiki/Finnish_Trade_Register
2727
28-
::
28+
Examples::
2929
3030
>>> assert fi_business_id('0112038-9') # Fast Monkeys Ltd
3131
@@ -56,13 +56,12 @@ def fi_ssn(ssn):
5656
.. _django-localflavor-fi:
5757
https://github.com/django/django-localflavor-fi/
5858
59-
::
59+
Examples::
6060
6161
>>> assert fi_ssn('010101-0101')
6262
6363
>>> assert not fi_ssn('101010-0102')
6464
65-
6665
.. versionadded:: 0.5
6766
6867
:param ssn: Social Security Number to validate

‎validators/ip_address.py‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ def ipv4(value):
1111
.. _WTForms IPAddress validator:
1212
https://github.com/wtforms/wtforms/blob/master/wtforms/validators.py
1313
14-
1514
Examples::
1615
17-
1816
>>> import validators
1917
2018
>>> validators.ipv4('123.0.0.7')
@@ -43,15 +41,12 @@ def ipv6(value):
4341
.. _WTForms IPAddress validator:
4442
https://github.com/wtforms/wtforms/blob/master/wtforms/validators.py
4543
46-
4744
Examples::
4845
49-
5046
>>> assert validators.ipv6('abcd:ef::42:1')
5147
5248
>>> assert not validators.ipv6('abc.0.0.1')
5349
54-
5550
.. versionadded:: 0.2
5651
5752
:param value: IP address string to validate

‎validators/length.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@ def length(value, min=None, max=None):
1010
1111
Examples::
1212
13-
1413
>>> assert length('something', min=2)
1514
1615
>>> assert length('something', min=9, max=9)
1716
1817
>>> assert not length('something', max=5)
1918
20-
2119
:param value:
2220
The string to validate.
2321
:param min:

‎validators/slug.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ def slug(value):
1111
Validates whether or not given value is valid slug (contains only
1212
alphanumeric characters, hyphens or underscores).
1313
14-
>>> assert not slug('my.slug')
14+
Examples::
1515
16-
>>> assert slug('my-slug-2134')
16+
>>> assert not slug('my.slug')
17+
18+
>>> assert slug('my-slug-2134')
1719
1820
.. versionadded:: 0.6
1921

‎validators/truthy.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ def truthy(value):
1414
1515
Examples::
1616
17-
1817
>>> assert truthy(1)
1918
2019
>>> assert truthy('someone')

‎validators/url.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ def url(value, require_tld=True):
3535
3636
>>> assert not validators.url('http://foobar.d')
3737
38-
3938
.. versionadded:: 0.2
4039
4140
:param value: URL address string to validate

‎validators/utils.py‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,7 @@ def validator(func, *args, **kwargs):
5959
function is called and returns False value this decorator returns
6060
ValidationFailure object.
6161
62-
Example:
63-
64-
::
65-
62+
Example::
6663
6764
>>> from validators import validator
6865
@@ -78,7 +75,6 @@ def validator(func, *args, **kwargs):
7875
>>> even(5)
7976
ValidationFailure(func=even, args={'value': 5})
8077
81-
8278
:param func: function to decorate
8379
:param *args: positional function arguments
8480
:param **kwargs: key value function arguments

0 commit comments

Comments
 (0)