summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bblayers
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-12 07:30:35 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-02 07:24:02 (GMT)
commit0f2c59367a649de5f57acdccfb4f1fdba9cde730 (patch)
tree7a3558a3e08e690fbb0b5bdc4044316f9ab4bbcb /bitbake/lib/bblayers
parentef1df516512587ad415f76a9626620992d660e45 (diff)
downloadpoky-0f2c59367a649de5f57acdccfb4f1fdba9cde730.tar.gz
bitbake: bitbake: Convert to python 3
Various misc changes to convert bitbake to python3 which don't warrant separation into separate commits. (Bitbake rev: d0f904d407f57998419bd9c305ce53e5eaa36b24) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bblayers')
-rw-r--r--bitbake/lib/bblayers/action.py2
-rw-r--r--bitbake/lib/bblayers/common.py2
-rw-r--r--bitbake/lib/bblayers/layerindex.py12
-rw-r--r--bitbake/lib/bblayers/query.py4
4 files changed, 10 insertions, 10 deletions
diff --git a/bitbake/lib/bblayers/action.py b/bitbake/lib/bblayers/action.py
index 5b95e2e..d4c1792 100644
--- a/bitbake/lib/bblayers/action.py
+++ b/bitbake/lib/bblayers/action.py
@@ -117,7 +117,7 @@ build results (as the layer priority order has effectively changed).
117 applied_appends = [] 117 applied_appends = []
118 for layer in layers: 118 for layer in layers:
119 overlayed = [] 119 overlayed = []
120 for f in self.tinfoil.cooker.collection.overlayed.iterkeys(): 120 for f in self.tinfoil.cooker.collection.overlayed.keys():
121 for of in self.tinfoil.cooker.collection.overlayed[f]: 121 for of in self.tinfoil.cooker.collection.overlayed[f]:
122 if of.startswith(layer): 122 if of.startswith(layer):
123 overlayed.append(of) 123 overlayed.append(of)
diff --git a/bitbake/lib/bblayers/common.py b/bitbake/lib/bblayers/common.py
index 360b9d7..b10fb4c 100644
--- a/bitbake/lib/bblayers/common.py
+++ b/bitbake/lib/bblayers/common.py
@@ -14,7 +14,7 @@ class LayerPlugin():
14 self.tinfoil = tinfoil 14 self.tinfoil = tinfoil
15 self.bblayers = (self.tinfoil.config_data.getVar('BBLAYERS', True) or "").split() 15 self.bblayers = (self.tinfoil.config_data.getVar('BBLAYERS', True) or "").split()
16 layerconfs = self.tinfoil.config_data.varhistory.get_variable_items_files('BBFILE_COLLECTIONS', self.tinfoil.config_data) 16 layerconfs = self.tinfoil.config_data.varhistory.get_variable_items_files('BBFILE_COLLECTIONS', self.tinfoil.config_data)
17 self.bbfile_collections = {layer: os.path.dirname(os.path.dirname(path)) for layer, path in layerconfs.iteritems()} 17 self.bbfile_collections = {layer: os.path.dirname(os.path.dirname(path)) for layer, path in layerconfs.items()}
18 18
19 @staticmethod 19 @staticmethod
20 def add_command(subparsers, cmdname, function, parserecipes=True, *args, **kwargs): 20 def add_command(subparsers, cmdname, function, parserecipes=True, *args, **kwargs):
diff --git a/bitbake/lib/bblayers/layerindex.py b/bitbake/lib/bblayers/layerindex.py
index 3c39d8a..10ad718 100644
--- a/bitbake/lib/bblayers/layerindex.py
+++ b/bitbake/lib/bblayers/layerindex.py
@@ -1,10 +1,10 @@
1import argparse 1import argparse
2import httplib 2import http.client
3import json 3import json
4import logging 4import logging
5import os 5import os
6import subprocess 6import subprocess
7import urlparse 7import urllib.parse
8 8
9from bblayers.action import ActionPlugin 9from bblayers.action import ActionPlugin
10 10
@@ -24,12 +24,12 @@ class LayerIndexPlugin(ActionPlugin):
24 def get_json_data(self, apiurl): 24 def get_json_data(self, apiurl):
25 proxy_settings = os.environ.get("http_proxy", None) 25 proxy_settings = os.environ.get("http_proxy", None)
26 conn = None 26 conn = None
27 _parsedurl = urlparse.urlparse(apiurl) 27 _parsedurl = urllib.parse.urlparse(apiurl)
28 path = _parsedurl.path 28 path = _parsedurl.path
29 query = _parsedurl.query 29 query = _parsedurl.query
30 30
31 def parse_url(url): 31 def parse_url(url):
32 parsedurl = urlparse.urlparse(url) 32 parsedurl = urllib.parse.urlparse(url)
33 if parsedurl.netloc[0] == '[': 33 if parsedurl.netloc[0] == '[':
34 host, port = parsedurl.netloc[1:].split(']', 1) 34 host, port = parsedurl.netloc[1:].split(']', 1)
35 if ':' in port: 35 if ':' in port:
@@ -46,11 +46,11 @@ class LayerIndexPlugin(ActionPlugin):
46 46
47 if proxy_settings is None: 47 if proxy_settings is None:
48 host, port = parse_url(apiurl) 48 host, port = parse_url(apiurl)
49 conn = httplib.HTTPConnection(host, port) 49 conn = http.client.HTTPConnection(host, port)
50 conn.request("GET", path + "?" + query) 50 conn.request("GET", path + "?" + query)
51 else: 51 else:
52 host, port = parse_url(proxy_settings) 52 host, port = parse_url(proxy_settings)
53 conn = httplib.HTTPConnection(host, port) 53 conn = http.client.HTTPConnection(host, port)
54 conn.request("GET", apiurl) 54 conn.request("GET", apiurl)
55 55
56 r = conn.getresponse() 56 r = conn.getresponse()
diff --git a/bitbake/lib/bblayers/query.py b/bitbake/lib/bblayers/query.py
index b5b98f7..b8c817b 100644
--- a/bitbake/lib/bblayers/query.py
+++ b/bitbake/lib/bblayers/query.py
@@ -128,7 +128,7 @@ skipped recipes will also be listed, with a " (skipped)" suffix.
128 # Ensure we list skipped recipes 128 # Ensure we list skipped recipes
129 # We are largely guessing about PN, PV and the preferred version here, 129 # We are largely guessing about PN, PV and the preferred version here,
130 # but we have no choice since skipped recipes are not fully parsed 130 # but we have no choice since skipped recipes are not fully parsed
131 skiplist = self.tinfoil.cooker.skiplist.keys() 131 skiplist = list(self.tinfoil.cooker.skiplist.keys())
132 skiplist.sort( key=lambda fileitem: self.tinfoil.cooker.collection.calc_bbfile_priority(fileitem) ) 132 skiplist.sort( key=lambda fileitem: self.tinfoil.cooker.collection.calc_bbfile_priority(fileitem) )
133 skiplist.reverse() 133 skiplist.reverse()
134 for fn in skiplist: 134 for fn in skiplist:
@@ -275,7 +275,7 @@ Lists recipes with the bbappends that apply to them as subitems.
275 275
276 def show_appends_for_skipped(self): 276 def show_appends_for_skipped(self):
277 filenames = [os.path.basename(f) 277 filenames = [os.path.basename(f)
278 for f in self.tinfoil.cooker.skiplist.iterkeys()] 278 for f in self.tinfoil.cooker.skiplist.keys()]
279 return self.show_appends_output(filenames, None, " (skipped)") 279 return self.show_appends_output(filenames, None, " (skipped)")
280 280
281 def show_appends_output(self, filenames, best_filename, name_suffix = ''): 281 def show_appends_output(self, filenames, best_filename, name_suffix = ''):