mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-12-26 22:51:25 +01:00
2018-12-10 Fred Gleason <fredg@paravelsystems.com>
* Added support for the 'ProcessNullUpdates=' directive in the 'pypad_udp.py' script. * Added support for the log selection directives in the 'pypad_udp.py' script.
This commit is contained in:
@@ -18154,3 +18154,8 @@
|
|||||||
* Fixed a bug in 'PyPAD.Update::resolvePadFields()' that caused
|
* Fixed a bug in 'PyPAD.Update::resolvePadFields()' that caused
|
||||||
incorrect rendering of 'dddd' placeholders when processing '%d(<dt>)'
|
incorrect rendering of 'dddd' placeholders when processing '%d(<dt>)'
|
||||||
wildcards.
|
wildcards.
|
||||||
|
2018-12-10 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Added support for the 'ProcessNullUpdates=' directive in the
|
||||||
|
'pypad_udp.py' script.
|
||||||
|
* Added support for the log selection directives in the
|
||||||
|
'pypad_udp.py' script.
|
||||||
|
|||||||
@@ -30,14 +30,38 @@ import PyPAD
|
|||||||
def eprint(*args,**kwargs):
|
def eprint(*args,**kwargs):
|
||||||
print(*args,file=sys.stderr,**kwargs)
|
print(*args,file=sys.stderr,**kwargs)
|
||||||
|
|
||||||
|
def processUpdate(update,section):
|
||||||
|
if config.get(section,'ProcessNullUpdates')=='0':
|
||||||
|
return True
|
||||||
|
if config.get(section,'ProcessNullUpdates')=='1':
|
||||||
|
return update.hasPadType(PyPAD.TYPE_NOW)
|
||||||
|
if config.get(section,'ProcessNullUpdates')=='2':
|
||||||
|
return update.hasPadType(PyPAD.TYPE_NEXT)
|
||||||
|
if config.get(section,'ProcessNullUpdates')=='3':
|
||||||
|
return update.hasPadType(PyPAD.TYPE_NOW) and update.hasPadType(PyPAD.TYPE_NEXT)
|
||||||
|
|
||||||
|
log_dict={1: 'MasterLog',2: 'Aux1Log',3: 'Aux2Log',
|
||||||
|
101: 'VLog101',102: 'VLog102',103: 'VLog103',104: 'VLog104',
|
||||||
|
105: 'VLog105',106: 'VLog106',107: 'VLog107',108: 'VLog108',
|
||||||
|
109: 'VLog109',110: 'VLog110',111: 'VLog111',112: 'VLog112',
|
||||||
|
113: 'VLog113',114: 'VLog114',115: 'VLog115',116: 'VLog116',
|
||||||
|
117: 'VLog117',118: 'VLog118',119: 'VLog119',120: 'VLog120'}
|
||||||
|
if config.get(section,log_dict[update.machine()]).lower()=='yes':
|
||||||
|
return True
|
||||||
|
if config.get(section,log_dict[update.machine()]).lower()=='no':
|
||||||
|
return False
|
||||||
|
if config.get(section,log_dict[update.machine()]).lower()=='onair':
|
||||||
|
return update.onairFlag()
|
||||||
|
|
||||||
def ProcessPad(update):
|
def ProcessPad(update):
|
||||||
n=1
|
n=1
|
||||||
while(True):
|
while(True):
|
||||||
section='Udp'+str(n)
|
section='Udp'+str(n)
|
||||||
try:
|
try:
|
||||||
fmtstr=config.get(section,'FormatString')
|
if processUpdate(update,section):
|
||||||
send_sock.sendto(update.resolvePadFields(fmtstr,int(config.get(section,'Encoding'))),
|
fmtstr=config.get(section,'FormatString')
|
||||||
(config.get(section,'IpAddress'),int(config.get(section,'UdpPort'))))
|
send_sock.sendto(update.resolvePadFields(fmtstr,int(config.get(section,'Encoding'))),
|
||||||
|
(config.get(section,'IpAddress'),int(config.get(section,'UdpPort'))))
|
||||||
n=n+1
|
n=n+1
|
||||||
except ConfigParser.NoSectionError:
|
except ConfigParser.NoSectionError:
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user