diff options
Diffstat (limited to 'lib/bb')
-rw-r--r-- | lib/bb/__init__.py | 2 | ||||
-rw-r--r-- | lib/bb/daemonize.py | 2 | ||||
-rw-r--r-- | lib/bb/data_smart.py | 2 | ||||
-rw-r--r-- | lib/bb/fetch2/osc.py | 3 | ||||
-rw-r--r-- | lib/bb/fetch2/ssh.py | 7 | ||||
-rw-r--r-- | lib/bb/msg.py | 1 | ||||
-rw-r--r-- | lib/bb/namedtuple_with_abc.py | 14 | ||||
-rw-r--r-- | lib/bb/process.py | 1 | ||||
-rw-r--r-- | lib/bb/server/process.py | 1 | ||||
-rw-r--r-- | lib/bb/tests/data.py | 1 | ||||
-rw-r--r-- | lib/bb/tinfoil.py | 2 | ||||
-rw-r--r-- | lib/bb/ui/knotty.py | 2 | ||||
-rw-r--r-- | lib/bb/ui/ncurses.py | 2 | ||||
-rw-r--r-- | lib/bb/ui/uievent.py | 6 |
14 files changed, 26 insertions, 20 deletions
diff --git a/lib/bb/__init__.py b/lib/bb/__init__.py index 2c94e10c8..888dd5ccc 100644 --- a/lib/bb/__init__.py +++ b/lib/bb/__init__.py @@ -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 diff --git a/lib/bb/daemonize.py b/lib/bb/daemonize.py index f01e6ec7c..c187fcfc6 100644 --- a/lib/bb/daemonize.py +++ b/lib/bb/daemonize.py @@ -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 diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py index 7f1b6dcb4..c559102cf 100644 --- a/lib/bb/data_smart.py +++ b/lib/bb/data_smart.py @@ -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): diff --git a/lib/bb/fetch2/osc.py b/lib/bb/fetch2/osc.py index 8f091efd0..3a6cd2951 100644 --- a/lib/bb/fetch2/osc.py +++ b/lib/bb/fetch2/osc.py @@ -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.""" diff --git a/lib/bb/fetch2/ssh.py b/lib/bb/fetch2/ssh.py index 5e982ecf3..2c8557e1f 100644 --- a/lib/bb/fetch2/ssh.py +++ b/lib/bb/fetch2/ssh.py @@ -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) diff --git a/lib/bb/msg.py b/lib/bb/msg.py index 1b1a23bb5..6f17b6acc 100644 --- a/lib/bb/msg.py +++ b/lib/bb/msg.py @@ -14,6 +14,7 @@ import sys import copy import logging import logging.config +import os from itertools import groupby import bb import bb.event diff --git a/lib/bb/namedtuple_with_abc.py b/lib/bb/namedtuple_with_abc.py index 646aed6ff..e46dbf084 100644 --- a/lib/bb/namedtuple_with_abc.py +++ b/lib/bb/namedtuple_with_abc.py @@ -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 diff --git a/lib/bb/process.py b/lib/bb/process.py index f36c929d2..7c3995cce 100644 --- a/lib/bb/process.py +++ b/lib/bb/process.py @@ -7,6 +7,7 @@ import signal import subprocess import errno import select +import bb logger = logging.getLogger('BitBake.Process') diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py index 005ac3477..74cdd3f3e 100644 --- a/lib/bb/server/process.py +++ b/lib/bb/server/process.py @@ -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 diff --git a/lib/bb/tests/data.py b/lib/bb/tests/data.py index 5f195047d..1d4a64b10 100644 --- a/lib/bb/tests/data.py +++ b/lib/bb/tests/data.py @@ -12,6 +12,7 @@ import bb import bb.data import bb.parse import logging +import os class LogRecord(): def __enter__(self): diff --git a/lib/bb/tinfoil.py b/lib/bb/tinfoil.py index e19d9cff0..5755e5a34 100644 --- a/lib/bb/tinfoil.py +++ b/lib/bb/tinfoil.py @@ -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 diff --git a/lib/bb/ui/knotty.py b/lib/bb/ui/knotty.py index 87e873d64..a3507afb7 100644 --- a/lib/bb/ui/knotty.py +++ b/lib/bb/ui/knotty.py @@ -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 diff --git a/lib/bb/ui/ncurses.py b/lib/bb/ui/ncurses.py index da4fbeabb..cf1c876a5 100644 --- a/lib/bb/ui/ncurses.py +++ b/lib/bb/ui/ncurses.py @@ -48,6 +48,8 @@ import bb import xmlrpc.client from bb.ui import uihelper +logger = logging.getLogger(__name__) + parsespin = itertools.cycle( r'|/-\\' ) X = 0 diff --git a/lib/bb/ui/uievent.py b/lib/bb/ui/uievent.py index 13d0d4a04..8607d0523 100644 --- a/lib/bb/ui/uievent.py +++ b/lib/bb/ui/uievent.py @@ -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")): |