summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/crumbs
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-06-18 07:56:55 -0700
committerRichard Purdie <rpurdie@linux.intel.com>2010-07-02 15:41:37 +0100
commit20dc452614c991d1a4f5b7dcc1307cd03cba0c55 (patch)
tree096376554cde186c8abea965a84b842dd3b8ff24 /bitbake/lib/bb/ui/crumbs
parentb9f8af16f4aca5df1849e0ee2904d58e120cb67d (diff)
downloadpoky-20dc452614c991d1a4f5b7dcc1307cd03cba0c55.tar.gz
Drop a couple usages of readlines
(Bitbake rev: 40925230781ddd550bf21d90714c5349f9240a51) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs')
-rw-r--r--bitbake/lib/bb/ui/crumbs/buildmanager.py43
1 files changed, 21 insertions, 22 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/buildmanager.py b/bitbake/lib/bb/ui/crumbs/buildmanager.py
index b5a4dae0de..e858d75e4c 100644
--- a/bitbake/lib/bb/ui/crumbs/buildmanager.py
+++ b/bitbake/lib/bb/ui/crumbs/buildmanager.py
@@ -76,31 +76,30 @@ class BuildConfiguration:
76 # file format. 76 # file format.
77 @staticmethod 77 @staticmethod
78 def load_from_file (filename): 78 def load_from_file (filename):
79 f = open (filename, "r")
80 79
81 conf = BuildConfiguration() 80 conf = BuildConfiguration()
82 for line in f.readlines(): 81 with open(filename, "r") as f:
83 data = line.split (";")[1] 82 for line in f:
84 if (line.startswith ("metadata-url;")): 83 data = line.split (";")[1]
85 conf.metadata_url = data.strip() 84 if (line.startswith ("metadata-url;")):
86 continue 85 conf.metadata_url = data.strip()
87 if (line.startswith ("url;")): 86 continue
88 conf.urls += [data.strip()] 87 if (line.startswith ("url;")):
89 continue 88 conf.urls += [data.strip()]
90 if (line.startswith ("extra-url;")): 89 continue
91 conf.extra_urls += [data.strip()] 90 if (line.startswith ("extra-url;")):
92 continue 91 conf.extra_urls += [data.strip()]
93 if (line.startswith ("machine;")): 92 continue
94 conf.machine = data.strip() 93 if (line.startswith ("machine;")):
95 continue 94 conf.machine = data.strip()
96 if (line.startswith ("distribution;")): 95 continue
97 conf.distro = data.strip() 96 if (line.startswith ("distribution;")):
98 continue 97 conf.distro = data.strip()
99 if (line.startswith ("image;")): 98 continue
100 conf.image = data.strip() 99 if (line.startswith ("image;")):
101 continue 100 conf.image = data.strip()
101 continue
102 102
103 f.close ()
104 return conf 103 return conf
105 104
106 # Serialise to a file. This is part of the build process and we use this 105 # Serialise to a file. This is part of the build process and we use this