aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/event.py
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-01-19 09:47:36 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2010-01-19 09:47:36 +0000
commit3162f336ed21b2646a82b0b87132656cbb59fc81 (patch)
treeabb56242af3d0a89f6b61e56ab6ea5be49a733d0 /lib/bb/event.py
parent19a6dc1fe6e6a0d957710197e4420a3fc2b821f4 (diff)
downloadbitbake-3162f336ed21b2646a82b0b87132656cbb59fc81.tar.gz
bitbake-3162f336ed21b2646a82b0b87132656cbb59fc81.tar.bz2
bitbake-3162f336ed21b2646a82b0b87132656cbb59fc81.zip
event.py: Pass the datastore to the fire command, don't build it into events
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'lib/bb/event.py')
-rw-r--r--lib/bb/event.py49
1 files changed, 18 insertions, 31 deletions
diff --git a/lib/bb/event.py b/lib/bb/event.py
index 86b566fe..ff4f2327 100644
--- a/lib/bb/event.py
+++ b/lib/bb/event.py
@@ -31,20 +31,10 @@ worker_pid = 0
class Event:
"""Base class for events"""
- type = "Event"
- def __init__(self, d):
- self._data = d
+ def __init__(self):
self.pid = worker_pid
- def getData(self):
- return self._data
-
- def setData(self, data):
- self._data = data
-
- data = property(getData, setData, None, "data property")
-
NotHandled = 0
Handled = 1
@@ -56,21 +46,18 @@ _handlers = {}
_ui_handlers = {}
_ui_handler_seq = 0
-def fire(event):
+def fire(event, d):
"""Fire off an Event"""
for handler in _handlers:
h = _handlers[handler]
+ event.data = d
if type(h).__name__ == "code":
exec(h)
tmpHandler(event)
else:
h(event)
-
- # Remove the event data elements for UI handlers - too much data otherwise
- # They can request data if they need it
- event.data = None
- event._data = None
+ del event.data
errors = []
for h in _ui_handlers:
@@ -128,17 +115,17 @@ class ConfigParsed(Event):
class RecipeParsed(Event):
""" Recipe Parsing Complete """
- def __init__(self, fn, d):
+ def __init__(self, fn):
self.fn = fn
- Event.__init__(self, d)
+ Event.__init__(self)
class StampUpdate(Event):
"""Trigger for any adjustment of the stamp files to happen"""
- def __init__(self, targets, stampfns, d):
+ def __init__(self, targets, stampfns):
self._targets = targets
self._stampfns = stampfns
- Event.__init__(self, d)
+ Event.__init__(self)
def getStampPrefix(self):
return self._stampfns
@@ -169,10 +156,10 @@ class PkgBase(Event):
class BuildBase(Event):
"""Base class for bbmake run events"""
- def __init__(self, n, p, c, failures = 0):
+ def __init__(self, n, p, failures = 0):
self._name = n
self._pkgs = p
- Event.__init__(self, c)
+ Event.__init__(self)
self._failures = failures
def getPkgs(self):
@@ -238,8 +225,8 @@ class RecursiveDep(DepBase):
class NoProvider(Event):
"""No Provider for an Event"""
- def __init__(self, item, data, runtime=False):
- Event.__init__(self, data)
+ def __init__(self, item, runtime=False):
+ Event.__init__(self)
self._item = item
self._runtime = runtime
@@ -252,8 +239,8 @@ class NoProvider(Event):
class MultipleProviders(Event):
"""Multiple Providers"""
- def __init__(self, item, candidates, data, runtime = False):
- Event.__init__(self, data)
+ def __init__(self, item, candidates, runtime = False):
+ Event.__init__(self)
self._item = item
self._candidates = candidates
self._is_runtime = runtime
@@ -281,8 +268,8 @@ class ParseProgress(Event):
Parsing Progress Event
"""
- def __init__(self, d, cached, parsed, skipped, masked, errors, total):
- Event.__init__(self, d)
+ def __init__(self, cached, parsed, skipped, masked, errors, total):
+ Event.__init__(self)
self.cached = cached
self.parsed = parsed
self.skipped = skipped
@@ -296,7 +283,7 @@ class DepTreeGenerated(Event):
Event when a dependency tree has been generated
"""
- def __init__(self, d, depgraph):
- Event.__init__(self, d)
+ def __init__(self, depgraph):
+ Event.__init__(self)
self._depgraph = depgraph