From 881e8a6a2429b43180e1ece0148077bdb77c59d5 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Fri, 19 Aug 2011 08:22:13 +0000 Subject: make source code layout follow PEP8 more git-svn-id: http://arthurdejong.org/svn/python-stdnum/python-stdnum@76 9dea7c4f-944c-4273-ac1a-574ede026edc --- stdnum/us/ssn.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'stdnum/us') diff --git a/stdnum/us/ssn.py b/stdnum/us/ssn.py index 507b1b5..62752e6 100644 --- a/stdnum/us/ssn.py +++ b/stdnum/us/ssn.py @@ -38,13 +38,15 @@ import re _ssn_re = re.compile('^(?P[0-9]{3})-?(?P[0-9]{2})-?(?P[0-9]{4})$') # blacklist of SSNs -_ssn_blacklist = set(( '078-05-1120', '457-55-5462', '219-09-9999' )) +_ssn_blacklist = set(('078-05-1120', '457-55-5462', '219-09-9999')) + def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return number.replace('-', '').strip() + def is_valid(number): """Checks to see if the number provided is a valid SSN. This checks the length, groups and formatting if it is present.""" @@ -65,6 +67,7 @@ def is_valid(number): # check blacklists return format(number) not in _ssn_blacklist + def format(number): """Reformat the passed number to the standard format.""" if len(number) == 9: -- cgit v1.2.3