mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2026-01-13 08:05:55 +01:00
2018-12-06 Fred Gleason <fredg@paravelsystems.com>
* Removed support for the 'priv' argument in callbacks in PyPAD scripts.
This commit is contained in:
@@ -18104,3 +18104,6 @@
|
|||||||
* Added a set of Python classes for processing PAD updates.
|
* Added a set of Python classes for processing PAD updates.
|
||||||
2018-12-06 Fred Gleason <fredg@paravelsystems.com>
|
2018-12-06 Fred Gleason <fredg@paravelsystems.com>
|
||||||
* Added comments to the 'now_and_next.py' PyPAD script.
|
* Added comments to the 'now_and_next.py' PyPAD script.
|
||||||
|
2018-12-06 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Removed support for the 'priv' argument in callbacks in PyPAD
|
||||||
|
scripts.
|
||||||
|
|||||||
@@ -152,10 +152,9 @@ class PyPADUpdate(object):
|
|||||||
class PyPADReceiver(object):
|
class PyPADReceiver(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.__callback=None
|
self.__callback=None
|
||||||
self.__priv=None
|
|
||||||
|
|
||||||
def __PyPAD_Process(self,pad):
|
def __PyPAD_Process(self,pad):
|
||||||
self.__callback(pad,self.__priv)
|
self.__callback(pad)
|
||||||
|
|
||||||
def setCallback(self,cb):
|
def setCallback(self,cb):
|
||||||
"""
|
"""
|
||||||
@@ -163,13 +162,6 @@ class PyPADReceiver(object):
|
|||||||
"""
|
"""
|
||||||
self.__callback=cb
|
self.__callback=cb
|
||||||
|
|
||||||
def setPrivateObject(self,obj):
|
|
||||||
"""
|
|
||||||
Set the 'private' object. This object will be passed to the
|
|
||||||
callback in its second argument.
|
|
||||||
"""
|
|
||||||
self.priv=obj
|
|
||||||
|
|
||||||
def start(self,hostname):
|
def start(self,hostname):
|
||||||
"""
|
"""
|
||||||
Connect to a Rivendell system and begin processing PAD events.
|
Connect to a Rivendell system and begin processing PAD events.
|
||||||
|
|||||||
@@ -31,16 +31,10 @@ import rivendell.PyPAD
|
|||||||
|
|
||||||
#
|
#
|
||||||
# First, we create a callback method, that will be called every time a
|
# First, we create a callback method, that will be called every time a
|
||||||
# log machine updates its PAD. Two arguments are supplied:
|
# log machine updates its PAD. An instance of 'PyPADUpdate' that contains
|
||||||
|
# the PAD information is supplied as the single argument.
|
||||||
#
|
#
|
||||||
# update - An instance of 'PyPADUpdate' that contains the PAD information.
|
def ProcessPad(update):
|
||||||
#
|
|
||||||
# priv - An arbitrary object that was passed to 'PyPADReceiver' using
|
|
||||||
# its 'setPrivateObject()' method. This allows initialiation to
|
|
||||||
# be done (create sockets, file handles, etc) before starting the
|
|
||||||
# receiver and then passing those objects to the processing callback.
|
|
||||||
#
|
|
||||||
def ProcessPad(update,priv):
|
|
||||||
print
|
print
|
||||||
if update.hasNowPad():
|
if update.hasNowPad():
|
||||||
print "Log %03d NOW: " % update.logMachine()+update.padFields("%a - %t")
|
print "Log %03d NOW: " % update.logMachine()+update.padFields("%a - %t")
|
||||||
|
|||||||
Reference in New Issue
Block a user