summaryrefslogtreecommitdiffstats
path: root/lib/bb/ui/crumbs
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-06-18 07:56:55 -0700
committerChris Larson <chris_larson@mentor.com>2010-06-21 08:05:12 -0700
commit40925230781ddd550bf21d90714c5349f9240a51 (patch)
tree2df61d0f2d5af49913d2d72ac6370ece14d9f0ac /lib/bb/ui/crumbs
parent65a51bb20677148a29b9e472f6d9d0a97798f024 (diff)
downloadbitbake-40925230781ddd550bf21d90714c5349f9240a51.tar.gz
Drop a couple usages of readlines
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'lib/bb/ui/crumbs')
-rw-r--r--lib/bb/ui/crumbs/buildmanager.py43
1 files changed, 21 insertions, 22 deletions
diff --git a/lib/bb/ui/crumbs/buildmanager.py b/lib/bb/ui/crumbs/buildmanager.py
index b5a4dae0d..e858d75e4 100644
--- a/lib/bb/ui/crumbs/buildmanager.py
+++ b/lib/bb/ui/crumbs/buildmanager.py
@@ -76,31 +76,30 @@ class BuildConfiguration:
# file format.
@staticmethod
def load_from_file (filename):
- f = open (filename, "r")
conf = BuildConfiguration()
- for line in f.readlines():
- data = line.split (";")[1]
- if (line.startswith ("metadata-url;")):
- conf.metadata_url = data.strip()
- continue
- if (line.startswith ("url;")):
- conf.urls += [data.strip()]
- continue
- if (line.startswith ("extra-url;")):
- conf.extra_urls += [data.strip()]
- continue
- if (line.startswith ("machine;")):
- conf.machine = data.strip()
- continue
- if (line.startswith ("distribution;")):
- conf.distro = data.strip()
- continue
- if (line.startswith ("image;")):
- conf.image = data.strip()
- continue
+ with open(filename, "r") as f:
+ for line in f:
+ data = line.split (";")[1]
+ if (line.startswith ("metadata-url;")):
+ conf.metadata_url = data.strip()
+ continue
+ if (line.startswith ("url;")):
+ conf.urls += [data.strip()]
+ continue
+ if (line.startswith ("extra-url;")):
+ conf.extra_urls += [data.strip()]
+ continue
+ if (line.startswith ("machine;")):
+ conf.machine = data.strip()
+ continue
+ if (line.startswith ("distribution;")):
+ conf.distro = data.strip()
+ continue
+ if (line.startswith ("image;")):
+ conf.image = data.strip()
+ continue
- f.close ()
return conf
# Serialise to a file. This is part of the build process and we use this