diff options
author | Chris Larson <chris_larson@mentor.com> | 2010-03-23 20:33:19 -0700 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-03-25 17:25:51 +0000 |
commit | ec3f9089485a4d77f777c3512646874f608bcc2d (patch) | |
tree | 40c56021691b328f151e4f19dced5dacff0f515e /bitbake/lib/bb/utils.py | |
parent | 80a52e7ad64d0870db18cddeda9588dc5b723f52 (diff) | |
download | openembedded-core-ec3f9089485a4d77f777c3512646874f608bcc2d.tar.gz openembedded-core-ec3f9089485a4d77f777c3512646874f608bcc2d.tar.bz2 openembedded-core-ec3f9089485a4d77f777c3512646874f608bcc2d.zip |
bb.utils: utilize string.letters and string.digits
(Bitbake rev: 7af05cba87ec9f3ea5e53689b3d9f0a63784d1b5)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/utils.py')
-rw-r--r-- | bitbake/lib/bb/utils.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 1bb9e9472d..ef049f7c7b 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py @@ -19,23 +19,21 @@ BitBake Utility Functions # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -digits = "0123456789" -ascii_letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" separators = ".-" -import re, fcntl, os, types, bb +import re, fcntl, os, types, bb, string def explode_version(s): r = [] alpha_regexp = re.compile('^([a-zA-Z]+)(.*)$') numeric_regexp = re.compile('^(\d+)(.*)$') while (s != ''): - if s[0] in digits: + if s[0] in string.digits: m = numeric_regexp.match(s) r.append(int(m.group(1))) s = m.group(2) continue - if s[0] in ascii_letters: + if s[0] in string.letters: m = alpha_regexp.match(s) r.append(m.group(1)) s = m.group(2) |