From 41dd8159b43e72f44f2e3ca0afcdeaac563b7180 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sat, 4 Feb 2012 19:15:00 +0000 Subject: implement a stdnum.util module for holding utility functions (for now clean()) git-svn-id: http://arthurdejong.org/svn/python-stdnum/python-stdnum@100 9dea7c4f-944c-4273-ac1a-574ede026edc --- stdnum/meid.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'stdnum/meid.py') diff --git a/stdnum/meid.py b/stdnum/meid.py index ff6aa20..b162dde 100644 --- a/stdnum/meid.py +++ b/stdnum/meid.py @@ -1,6 +1,6 @@ # meid.py - functions for handling Mobile Equipment Identifiers (MEIDs) # -# Copyright (C) 2010, 2011 Arthur de Jong +# Copyright (C) 2010, 2011, 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -32,13 +32,16 @@ True 'AF 01 23 45 0A BC DE C' """ +from stdnum.util import clean + + _hex_alphabet = '0123456789ABCDEF' def _cleanup(number): """Remove any grouping information from the number and removes surrounding whitespace.""" - return str(number).replace(' ', '').replace('-', '').strip().upper() + return clean(str(number), ' -').strip().upper() def _ishex(number): -- cgit v1.2.3