summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/3rdparty/pykickstart/version.py
diff options
context:
space:
mode:
authorTom Zanussi <tom.zanussi@linux.intel.com>2014-09-09 11:21:59 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-09-10 11:33:25 +0100
commit5bef32283f53e7f1bbde81fbb95c8682e29f082a (patch)
tree22615a3c0e5f86a1f590df03ec40b3b085836f47 /scripts/lib/wic/3rdparty/pykickstart/version.py
parent7576bd99825a105f1bdc3efc22ed1d0e007f57cc (diff)
downloadpoky-5bef32283f53e7f1bbde81fbb95c8682e29f082a.tar.gz
wic: Completely remove all urlgrabber references
The previous commit, 'wic: Remove 3rdparty/urlgrabber' didn't actually remove all references to urlgrabber - this does however. (From OE-Core rev: b4367af770611174d9de82c63c697d4347e30dcf) Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic/3rdparty/pykickstart/version.py')
-rw-r--r--scripts/lib/wic/3rdparty/pykickstart/version.py29
1 files changed, 0 insertions, 29 deletions
diff --git a/scripts/lib/wic/3rdparty/pykickstart/version.py b/scripts/lib/wic/3rdparty/pykickstart/version.py
index 102cc37d80..8a8e6aad22 100644
--- a/scripts/lib/wic/3rdparty/pykickstart/version.py
+++ b/scripts/lib/wic/3rdparty/pykickstart/version.py
@@ -44,7 +44,6 @@ This module also exports several functions:
44 have a version= comment in it. 44 have a version= comment in it.
45""" 45"""
46import imputil, re, sys 46import imputil, re, sys
47from urlgrabber import urlopen
48 47
49import gettext 48import gettext
50_ = lambda x: gettext.ldgettext("pykickstart", x) 49_ = lambda x: gettext.ldgettext("pykickstart", x)
@@ -132,34 +131,6 @@ def versionToString(version, skipDevel=False):
132 131
133 raise KickstartVersionError(_("Unsupported version specified: %s") % version) 132 raise KickstartVersionError(_("Unsupported version specified: %s") % version)
134 133
135def versionFromFile(f):
136 """Given a file or URL, look for a line starting with #version= and
137 return the version number. If no version is found, return DEVEL.
138 """
139 v = DEVEL
140
141 fh = urlopen(f)
142
143 while True:
144 try:
145 l = fh.readline()
146 except StopIteration:
147 break
148
149 # At the end of the file?
150 if l == "":
151 break
152
153 if l.isspace() or l.strip() == "":
154 continue
155
156 if l[:9] == "#version=":
157 v = stringToVersion(l[9:].rstrip())
158 break
159
160 fh.close()
161 return v
162
163def returnClassForVersion(version=DEVEL): 134def returnClassForVersion(version=DEVEL):
164 """Return the class of the syntax handler for version. version can be 135 """Return the class of the syntax handler for version. version can be
165 either a string or the matching constant. Raises KickstartValueError 136 either a string or the matching constant. Raises KickstartValueError