1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-02 13:29:49 +00:00

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>
This commit is contained in:
Richard Purdie
2016-05-12 08:30:35 +01:00
parent ef1df51651
commit 0f2c59367a
63 changed files with 390 additions and 400 deletions
+1 -1
View File
@@ -612,7 +612,7 @@ class HobIconChecker(hic):
def set_hob_icon_to_stock_icon(self, file_path, stock_id=""):
try:
pixbuf = gtk.gdk.pixbuf_new_from_file(file_path)
except Exception, e:
except Exception as e:
return None
if stock_id and (gtk.icon_factory_lookup_default(stock_id) == None):
+3 -3
View File
@@ -44,9 +44,9 @@ class HobProgressBar (gtk.ProgressBar):
self.set_text(text)
def set_stop_title(self, text=None):
if not text:
text = ""
self.set_text(text)
if not text:
text = ""
self.set_text(text)
def reset(self):
self.set_fraction(0)
+6 -6
View File
@@ -23,14 +23,14 @@ import gtk
import gobject
import logging
import time
import urllib
import urllib2
import urllib.request, urllib.parse, urllib.error
import urllib.request, urllib.error, urllib.parse
import pango
from bb.ui.crumbs.hobcolor import HobColors
from bb.ui.crumbs.hobwidget import HobWarpCellRendererText, HobCellRendererPixbuf
class RunningBuildModel (gtk.TreeStore):
(COL_LOG, COL_PACKAGE, COL_TASK, COL_MESSAGE, COL_ICON, COL_COLOR, COL_NUM_ACTIVE) = range(7)
(COL_LOG, COL_PACKAGE, COL_TASK, COL_MESSAGE, COL_ICON, COL_COLOR, COL_NUM_ACTIVE) = list(range(7))
def __init__ (self):
gtk.TreeStore.__init__ (self,
@@ -443,8 +443,8 @@ def do_pastebin(text):
url = 'http://pastebin.com/api_public.php'
params = {'paste_code': text, 'paste_format': 'text'}
req = urllib2.Request(url, urllib.urlencode(params))
response = urllib2.urlopen(req)
req = urllib.request.Request(url, urllib.parse.urlencode(params))
response = urllib.request.urlopen(req)
paste_url = response.read()
return paste_url
@@ -519,7 +519,7 @@ class RunningBuildTreeView (gtk.TreeView):
# @todo Provide visual feedback to the user that it is done and that
# it worked.
print paste_url
print(paste_url)
self._add_to_clipboard(paste_url)
+8 -3
View File
@@ -18,13 +18,18 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from gi import pygtkcompat
pygtkcompat.enable()
pygtkcompat.enable_gtk(version='3.0')
import gobject
import gtk
import xmlrpclib
import xmlrpc.client
from bb.ui.crumbs.runningbuild import RunningBuildTreeView, RunningBuild
from bb.ui.crumbs.progress import ProgressBar
import Queue
import queue
def event_handle_idle_func (eventHandler, build, pbar):
@@ -96,7 +101,7 @@ def main (server, eventHandler, params):
elif ret != True:
print("Error running command '%s': returned %s" % (cmdline, ret))
return 1
except xmlrpclib.Fault as x:
except xmlrpcclient.Fault as x:
print("XMLRPC Fault getting commandline:\n %s" % x)
return 1
+3 -3
View File
@@ -22,7 +22,7 @@ from __future__ import division
import os
import sys
import xmlrpclib
import xmlrpc.client as xmlrpclib
import logging
import progressbar
import signal
@@ -184,8 +184,8 @@ class TerminalFilter(object):
def clearFooter(self):
if self.footer_present:
lines = self.footer_present
sys.stdout.write(self.curses.tparm(self.cuu, lines))
sys.stdout.write(self.curses.tparm(self.ed))
sys.stdout.buffer.write(self.curses.tparm(self.cuu, lines))
sys.stdout.buffer.write(self.curses.tparm(self.ed))
sys.stdout.flush()
self.footer_present = False
+4 -4
View File
@@ -45,7 +45,7 @@
"""
from __future__ import division
import logging
import os, sys, itertools, time, subprocess
@@ -55,7 +55,7 @@ except ImportError:
sys.exit("FATAL: The ncurses ui could not load the required curses python module.")
import bb
import xmlrpclib
import xmlrpc.client
from bb import ui
from bb.ui import uihelper
@@ -252,7 +252,7 @@ class NCursesUI:
elif ret != True:
print("Couldn't get default commandlind! %s" % ret)
return
except xmlrpclib.Fault as x:
except xmlrpc.client.Fault as x:
print("XMLRPC Fault getting commandline:\n %s" % x)
return
@@ -331,7 +331,7 @@ class NCursesUI:
taw.setText(0, 0, "")
if activetasks:
taw.appendText("Active Tasks:\n")
for task in activetasks.itervalues():
for task in activetasks.values():
taw.appendText(task["title"] + '\n')
if failedtasks:
taw.appendText("Failed Tasks:\n")
+2 -2
View File
@@ -25,7 +25,7 @@ client/server deadlocks.
"""
import socket, threading, pickle, collections
from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
from xmlrpc.server import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
class BBUIEventQueue:
def __init__(self, BBServer, clientinfo=("localhost, 0")):
@@ -137,7 +137,7 @@ class UIXMLRPCServer (SimpleXMLRPCServer):
SimpleXMLRPCServer.__init__( self,
interface,
requestHandler=SimpleXMLRPCRequestHandler,
logRequests=False, allow_none=True)
logRequests=False, allow_none=True, use_builtin_types=True)
def get_request(self):
while not self.quit: