1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 00:20:08 +00:00

bitbake: lib: fix most undefined code picked up by pylint

Correctly import, and inherit functions, and variables.
Also fix some typos and remove some Python 2 code that isn't recognised.

(Bitbake rev: b0c807be5c2170c9481c1a04d4c11972135d7dc5)

Signed-off-by: Frazer Clews <frazerleslieclews@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Frazer Clews
2020-08-24 15:51:37 +01:00
committed by Richard Purdie
parent ac3593f6ed
commit abc6f864b9
22 changed files with 51 additions and 42 deletions
+1 -1
View File
@@ -93,7 +93,7 @@ class BBLoggerAdapter(logging.LoggerAdapter, BBLoggerMixin):
def __repr__(self):
logger = self.logger
level = getLevelName(logger.getEffectiveLevel())
level = logger.getLevelName(logger.getEffectiveLevel())
return '<%s %s (%s)>' % (self.__class__.__name__, logger.name, level)
logging.LoggerAdapter = BBLoggerAdapter
+2
View File
@@ -14,6 +14,8 @@ import sys
import io
import traceback
import bb
def createDaemon(function, logfile):
"""
Detach a process from the controlling terminal and run it in the
+1 -1
View File
@@ -189,7 +189,7 @@ class IncludeHistory(object):
if self.current.parent:
self.current = self.current.parent
else:
bb.warn("Include log: Tried to finish '%s' at top level." % filename)
bb.warn("Include log: Tried to finish '%s' at top level." % self.filename)
return False
def emit(self, o, level = 0):
+3
View File
@@ -8,12 +8,15 @@ Based on the svn "Fetch" implementation.
"""
import logging
import os
import bb
from bb.fetch2 import FetchMethod
from bb.fetch2 import FetchError
from bb.fetch2 import MissingParameterError
from bb.fetch2 import runfetchcmd
logger = logging.getLogger(__name__)
class Osc(FetchMethod):
"""Class to fetch a module or modules from Opensuse build server
repositories."""
+3 -4
View File
@@ -31,8 +31,7 @@ IETF secsh internet draft:
#
import re, os
from bb.fetch2 import FetchMethod
from bb.fetch2 import runfetchcmd
from bb.fetch2 import check_network_access, FetchMethod, ParameterError, runfetchcmd
__pattern__ = re.compile(r'''
@@ -65,7 +64,7 @@ class SSH(FetchMethod):
def urldata_init(self, urldata, d):
if 'protocol' in urldata.parm and urldata.parm['protocol'] == 'git':
raise bb.fetch2.ParameterError(
raise ParameterError(
"Invalid protocol - if you wish to fetch from a git " +
"repository using ssh, you need to use " +
"git:// prefix with protocol=ssh", urldata.url)
@@ -105,7 +104,7 @@ class SSH(FetchMethod):
dldir
)
bb.fetch2.check_network_access(d, cmd, urldata.url)
check_network_access(d, cmd, urldata.url)
runfetchcmd(cmd, d)
+1
View File
@@ -14,6 +14,7 @@ import sys
import copy
import logging
import logging.config
import os
from itertools import groupby
import bb
import bb.event
+3 -11
View File
@@ -61,17 +61,9 @@ class _NamedTupleABCMeta(ABCMeta):
return ABCMeta.__new__(mcls, name, bases, namespace)
exec(
# Python 2.x metaclass declaration syntax
"""class _NamedTupleABC(object):
'''The abstract base class + mix-in for named tuples.'''
__metaclass__ = _NamedTupleABCMeta
_fields = abstractproperty()""" if version_info[0] < 3 else
# Python 3.x metaclass declaration syntax
"""class _NamedTupleABC(metaclass=_NamedTupleABCMeta):
'''The abstract base class + mix-in for named tuples.'''
_fields = abstractproperty()"""
)
class _NamedTupleABC(metaclass=_NamedTupleABCMeta):
'''The abstract base class + mix-in for named tuples.'''
_fields = abstractproperty()
_namedtuple.abc = _NamedTupleABC
+1
View File
@@ -7,6 +7,7 @@ import signal
import subprocess
import errno
import select
import bb
logger = logging.getLogger('BitBake.Process')
+1
View File
@@ -25,6 +25,7 @@ import subprocess
import errno
import re
import datetime
import pickle
import bb.server.xmlrpcserver
from bb import daemonize
from multiprocessing import queues
+1
View File
@@ -12,6 +12,7 @@ import bb
import bb.data
import bb.parse
import logging
import os
class LogRecord():
def __enter__(self):
+1 -1
View File
@@ -732,7 +732,7 @@ class Tinfoil:
continue
if helper.eventHandler(event):
if isinstance(event, bb.build.TaskFailedSilent):
logger.warning("Logfile for failed setscene task is %s" % event.logfile)
self.logger.warning("Logfile for failed setscene task is %s" % event.logfile)
elif isinstance(event, bb.build.TaskFailed):
bb.ui.knotty.print_event_log(event, includelogs, loglines, termfilter)
continue
+1 -1
View File
@@ -144,7 +144,7 @@ class TerminalFilter(object):
pass
if not cr:
try:
cr = (env['LINES'], env['COLUMNS'])
cr = (os.environ['LINES'], os.environ['COLUMNS'])
except:
cr = (25, 80)
return cr
+2
View File
@@ -48,6 +48,8 @@ import bb
import xmlrpc.client
from bb.ui import uihelper
logger = logging.getLogger(__name__)
parsespin = itertools.cycle( r'|/-\\' )
X = 0
+5 -1
View File
@@ -11,9 +11,13 @@ server and queue them for the UI to process. This process must be used to avoid
client/server deadlocks.
"""
import socket, threading, pickle, collections
import collections, logging, pickle, socket, threading
from xmlrpc.server import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
import bb
logger = logging.getLogger(__name__)
class BBUIEventQueue:
def __init__(self, BBServer, clientinfo=("localhost, 0")):