bitbake: lib/bb/*.py: Typo fixes/grammar/comment fixes, nothing functional.

(Bitbake rev: 587b144ee409d444494d8d7f2d1c53ede8f7c953)

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Robert P. J. Day 2014-08-20 08:23:27 -04:00 committed by Richard Purdie
parent 91083de4cb
commit 6d08e5bb09
9 changed files with 29 additions and 27 deletions

View File

@ -103,7 +103,7 @@ def fatal(*args):
def deprecated(func, name=None, advice=""): def deprecated(func, name=None, advice=""):
"""This is a decorator which can be used to mark functions """This is a decorator which can be used to mark functions
as deprecated. It will result in a warning being emmitted as deprecated. It will result in a warning being emitted
when the function is used.""" when the function is used."""
import warnings import warnings

View File

@ -23,7 +23,7 @@
# with this program; if not, write to the Free Software Foundation, Inc., # with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# #
#Based on functions from the base bb module, Copyright 2003 Holger Schurig # Based on functions from the base bb module, Copyright 2003 Holger Schurig
import os import os
import sys import sys
@ -42,9 +42,8 @@ logger = logging.getLogger('BitBake.Build')
NULL = open(os.devnull, 'r+') NULL = open(os.devnull, 'r+')
# When we execute a Python function, we'd like certain things
# When we execute a python function we'd like certain things # in all namespaces, hence we add them to __builtins__.
# in all namespaces, hence we add them to __builtins__
# If we do not do this and use the exec globals, they will # If we do not do this and use the exec globals, they will
# not be available to subfunctions. # not be available to subfunctions.
__builtins__['bb'] = bb __builtins__['bb'] = bb
@ -143,7 +142,7 @@ class LogTee(object):
self.outfile.flush() self.outfile.flush()
def exec_func(func, d, dirs = None): def exec_func(func, d, dirs = None):
"""Execute an BB 'function'""" """Execute a BB 'function'"""
body = d.getVar(func) body = d.getVar(func)
if not body: if not body:
@ -417,7 +416,7 @@ def _exec_task(fn, task, d, quieterr):
os.dup2(logfile.fileno(), oso[1]) os.dup2(logfile.fileno(), oso[1])
os.dup2(logfile.fileno(), ose[1]) os.dup2(logfile.fileno(), ose[1])
# Ensure python logging goes to the logfile # Ensure Python logging goes to the logfile
handler = logging.StreamHandler(logfile) handler = logging.StreamHandler(logfile)
handler.setFormatter(logformatter) handler.setFormatter(logformatter)
# Always enable full debug output into task logfiles # Always enable full debug output into task logfiles

View File

@ -225,7 +225,7 @@ class CoreRecipeInfo(RecipeInfoCommon):
for package in self.packages_dynamic: for package in self.packages_dynamic:
cachedata.packages_dynamic[package].append(fn) cachedata.packages_dynamic[package].append(fn)
# Build hash of runtime depends and rececommends # Build hash of runtime depends and recommends
for package in self.packages + [self.pn]: for package in self.packages + [self.pn]:
cachedata.rundeps[fn][package] = list(self.rdepends) + self.rdepends_pkg[package] cachedata.rundeps[fn][package] = list(self.rdepends) + self.rdepends_pkg[package]
cachedata.runrecs[fn][package] = list(self.rrecommends) + self.rrecommends_pkg[package] cachedata.runrecs[fn][package] = list(self.rrecommends) + self.rrecommends_pkg[package]
@ -261,7 +261,7 @@ class Cache(object):
def __init__(self, data, data_hash, caches_array): def __init__(self, data, data_hash, caches_array):
# Pass caches_array information into Cache Constructor # Pass caches_array information into Cache Constructor
# It will be used in later for deciding whether we # It will be used later for deciding whether we
# need extra cache file dump/load support # need extra cache file dump/load support
self.caches_array = caches_array self.caches_array = caches_array
self.cachedir = data.getVar("CACHE", True) self.cachedir = data.getVar("CACHE", True)

View File

@ -12,8 +12,11 @@ A failed call to fork() now raises an exception.
References: References:
1) Advanced Programming in the Unix Environment: W. Richard Stevens 1) Advanced Programming in the Unix Environment: W. Richard Stevens
2) Unix Programming Frequently Asked Questions: http://www.apuebook.com/apue3e.html
http://www.erlenstar.demon.co.uk/unix/faq_toc.html 2) The Linux Programming Interface: Michael Kerrisk
http://man7.org/tlpi/index.html
3) Unix Programming Frequently Asked Questions:
http://www.faqs.org/faqs/unix-faq/programmer/faq/
Modified to allow a function to be daemonized and return for Modified to allow a function to be daemonized and return for
bitbake use by Richard Purdie bitbake use by Richard Purdie
@ -146,7 +149,7 @@ def createDaemon(function, logfile):
# OR # OR
# #
# Use the getrlimit method to retrieve the maximum file descriptor number # Use the getrlimit method to retrieve the maximum file descriptor number
# that can be opened by this process. If there is not limit on the # that can be opened by this process. If there is no limit on the
# resource, use the default value. # resource, use the default value.
# #
import resource # Resource usage information. import resource # Resource usage information.

View File

@ -6,7 +6,7 @@ BitBake 'Data' implementations
Functions for interacting with the data structure used by the Functions for interacting with the data structure used by the
BitBake build tools. BitBake build tools.
The expandData and update_data are the most expensive The expandKeys and update_data are the most expensive
operations. At night the cookie monster came by and operations. At night the cookie monster came by and
suggested 'give me cookies on setting the variables and suggested 'give me cookies on setting the variables and
things will work out'. Taking this suggestion into account things will work out'. Taking this suggestion into account
@ -15,7 +15,7 @@ Analyse von Algorithmen' lecture and the cookie
monster seems to be right. We will track setVar more carefully monster seems to be right. We will track setVar more carefully
to have faster update_data and expandKeys operations. to have faster update_data and expandKeys operations.
This is a treade-off between speed and memory again but This is a trade-off between speed and memory again but
the speed is more critical here. the speed is more critical here.
""" """
@ -35,7 +35,7 @@ the speed is more critical here.
# with this program; if not, write to the Free Software Foundation, Inc., # with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# #
#Based on functions from the base bb module, Copyright 2003 Holger Schurig # Based on functions from the base bb module, Copyright 2003 Holger Schurig
import sys, os, re import sys, os, re
if sys.argv[0][-5:] == "pydoc": if sys.argv[0][-5:] == "pydoc":

View File

@ -598,7 +598,7 @@ class MetadataEvent(Event):
class SanityCheck(Event): class SanityCheck(Event):
""" """
Event to runs sanity checks, either raise errors or generate events as return status. Event to run sanity checks, either raise errors or generate events as return status.
""" """
def __init__(self, generateevents = True): def __init__(self, generateevents = True):
Event.__init__(self) Event.__init__(self)
@ -606,7 +606,7 @@ class SanityCheck(Event):
class SanityCheckPassed(Event): class SanityCheckPassed(Event):
""" """
Event to indicate sanity check is passed Event to indicate sanity check has passed
""" """
class SanityCheckFailed(Event): class SanityCheckFailed(Event):

View File

@ -52,10 +52,10 @@ def getMountedDev(path):
parentDev = os.stat(path).st_dev parentDev = os.stat(path).st_dev
currentDev = parentDev currentDev = parentDev
# When the current directory's device is different from the # When the current directory's device is different from the
# parrent's, then the current directory is a mount point # parent's, then the current directory is a mount point
while parentDev == currentDev: while parentDev == currentDev:
mountPoint = path mountPoint = path
# Use dirname to get the parrent's directory # Use dirname to get the parent's directory
path = os.path.dirname(path) path = os.path.dirname(path)
# Reach the "/" # Reach the "/"
if path == mountPoint: if path == mountPoint:
@ -77,7 +77,7 @@ def getDiskData(BBDirs, configuration):
"""Prepare disk data for disk space monitor""" """Prepare disk data for disk space monitor"""
# Save the device IDs, need the ID to be unique (the dictionary's key is # Save the device IDs, need the ID to be unique (the dictionary's key is
# unique), so that when more than one directories are located in the same # unique), so that when more than one directory is located on the same
# device, we just monitor it once # device, we just monitor it once
devDict = {} devDict = {}
for pathSpaceInode in BBDirs.split(): for pathSpaceInode in BBDirs.split():
@ -187,11 +187,11 @@ class diskMonitor:
if self.spaceInterval and self.inodeInterval: if self.spaceInterval and self.inodeInterval:
self.enableMonitor = True self.enableMonitor = True
# These are for saving the previous disk free space and inode, we # These are for saving the previous disk free space and inode, we
# use them to avoid print too many warning messages # use them to avoid printing too many warning messages
self.preFreeS = {} self.preFreeS = {}
self.preFreeI = {} self.preFreeI = {}
# This is for STOPTASKS and ABORT, to avoid print the message repeatly # This is for STOPTASKS and ABORT, to avoid printing the message
# during waiting the tasks to finish # repeatedly while waiting for the tasks to finish
self.checked = {} self.checked = {}
for k in self.devDict: for k in self.devDict:
self.preFreeS[k] = 0 self.preFreeS[k] = 0

View File

@ -202,8 +202,8 @@ if __name__ == '__main__':
print(rec5._replace(k=222)._my_custom_method()) # MyMixIn's print(rec5._replace(k=222)._my_custom_method()) # MyMixIn's
print(rec5._replace(k=222).count(2)) # MyMixIn's print(rec5._replace(k=222).count(2)) # MyMixIn's
# None that behavior: the standard namedtuple methods cannot be # Note that behavior: the standard namedtuple methods cannot be
# overriden by a foreign mix-in -- even if the mix-in is declared # overridden by a foreign mix-in -- even if the mix-in is declared
# as the leftmost base class (but, obviously, you can override them # as the leftmost base class (but, obviously, you can override them
# in the defined class or its subclasses): # in the defined class or its subclasses):

View File

@ -264,7 +264,7 @@ def _print_trace(body, line):
def better_compile(text, file, realfile, mode = "exec"): def better_compile(text, file, realfile, mode = "exec"):
""" """
A better compile method. This method A better compile method. This method
will print the offending lines. will print the offending lines.
""" """
try: try:
return compile(text, file, mode) return compile(text, file, mode)
@ -530,7 +530,7 @@ def filter_environment(good_vars):
def approved_variables(): def approved_variables():
""" """
Determine and return the list of whitelisted variables which are approved Determine and return the list of whitelisted variables which are approved
to remain in the envrionment. to remain in the environment.
""" """
if 'BB_PRESERVE_ENV' in os.environ: if 'BB_PRESERVE_ENV' in os.environ:
return os.environ.keys() return os.environ.keys()