diff options
Diffstat (limited to 'scripts/lib/wic/3rdparty/pykickstart/version.py')
| -rw-r--r-- | scripts/lib/wic/3rdparty/pykickstart/version.py | 29 |
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 | """ |
| 46 | import imputil, re, sys | 46 | import imputil, re, sys |
| 47 | from urlgrabber import urlopen | ||
| 48 | 47 | ||
| 49 | import gettext | 48 | import 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 | ||
| 135 | def 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 | |||
| 163 | def returnClassForVersion(version=DEVEL): | 134 | def 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 |
