mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-30 07:32:32 +02:00
2021-12-12 Fred Gleason <fredg@paravelsystems.com>
* Added a 'SchedulerCode()' type class to the 'rivwebpyapi' API. * Modified the 'rivwebpyapi.ListCartSchedCodes()' call to return a list of 'rivwebpyapi.SchedulerCode' objects. * Modified the 'rivwebpyapi.ListSchedulerCodes()' call to return a list of 'rivwebpyapi.SchedulerCode' objects. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
c216bc618c
commit
b9164bad15
@ -22763,3 +22763,9 @@
|
|||||||
* Added an 'SaveLog()' method to the 'rivwebpyapi' API.
|
* Added an 'SaveLog()' method to the 'rivwebpyapi' API.
|
||||||
2021-12-12 Fred Gleason <fredg@paravelsystems.com>
|
2021-12-12 Fred Gleason <fredg@paravelsystems.com>
|
||||||
* Added a 'RivendellType()' base class to the 'rivwebpyapi' API.
|
* Added a 'RivendellType()' base class to the 'rivwebpyapi' API.
|
||||||
|
2021-12-12 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Added a 'SchedulerCode()' type class to the 'rivwebpyapi' API.
|
||||||
|
* Modified the 'rivwebpyapi.ListCartSchedCodes()' call to return
|
||||||
|
a list of 'rivwebpyapi.SchedulerCode' objects.
|
||||||
|
* Modified the 'rivwebpyapi.ListSchedulerCodes()' call to return
|
||||||
|
a list of 'rivwebpyapi.SchedulerCode' objects.
|
||||||
|
@ -219,6 +219,11 @@ LOGLINE_FIELDS={
|
|||||||
'extAnncType': 'string'
|
'extAnncType': 'string'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SCHEDULER_CODE_FIELDS={
|
||||||
|
'code': 'string',
|
||||||
|
'description': 'string'
|
||||||
|
}
|
||||||
|
|
||||||
class RivWebPyApi_ListHandler(ContentHandler):
|
class RivWebPyApi_ListHandler(ContentHandler):
|
||||||
def __init__(self,base_tag,fields):
|
def __init__(self,base_tag,fields):
|
||||||
self.__output=[]
|
self.__output=[]
|
||||||
@ -414,6 +419,10 @@ class LogLine(RivendellType):
|
|||||||
def __init__(self,values={}):
|
def __init__(self,values={}):
|
||||||
super().__init__(LOGLINE_FIELDS,values)
|
super().__init__(LOGLINE_FIELDS,values)
|
||||||
|
|
||||||
|
class SchedulerCode(RivendellType):
|
||||||
|
def __init__(self,values={}):
|
||||||
|
super().__init__(SCHEDULER_CODE_FIELDS,values)
|
||||||
|
|
||||||
class rivwebpyapi(object):
|
class rivwebpyapi(object):
|
||||||
"""
|
"""
|
||||||
Create a 'RivWebPyApi' object for accessing the Web API.
|
Create a 'RivWebPyApi' object for accessing the Web API.
|
||||||
@ -1279,7 +1288,7 @@ class rivwebpyapi(object):
|
|||||||
def ListCartSchedCodes(self,cart_number):
|
def ListCartSchedCodes(self,cart_number):
|
||||||
"""
|
"""
|
||||||
Returns the set of scheduler codes associated with a Rivendell
|
Returns the set of scheduler codes associated with a Rivendell
|
||||||
cart (list of dictionaries)
|
cart (list of rivwebpyapi.SchedulerCode objects).
|
||||||
|
|
||||||
Takes the following arguments:
|
Takes the following arguments:
|
||||||
|
|
||||||
@ -1308,17 +1317,15 @@ class rivwebpyapi(object):
|
|||||||
if(r.status_code!=requests.codes.ok):
|
if(r.status_code!=requests.codes.ok):
|
||||||
self.__throwError(response=r)
|
self.__throwError(response=r)
|
||||||
|
|
||||||
#
|
handler=RivWebPyApi_ListHandler(base_tag='schedCode',
|
||||||
# Generate the output dictionary
|
fields=SCHEDULER_CODE_FIELDS)
|
||||||
#
|
|
||||||
fields={
|
|
||||||
'code': 'string',
|
|
||||||
'description': 'string'
|
|
||||||
}
|
|
||||||
handler=RivWebPyApi_ListHandler(base_tag='schedCode',fields=fields)
|
|
||||||
xml.sax.parseString(r.text,handler)
|
xml.sax.parseString(r.text,handler)
|
||||||
|
out=handler.output()
|
||||||
|
ret=[]
|
||||||
|
for item in out:
|
||||||
|
ret.append(SchedulerCode(item))
|
||||||
|
|
||||||
return handler.output()
|
return ret
|
||||||
|
|
||||||
def ListCut(self,cart_number,cut_number):
|
def ListCut(self,cart_number,cut_number):
|
||||||
"""
|
"""
|
||||||
@ -1603,7 +1610,7 @@ class rivwebpyapi(object):
|
|||||||
def ListSchedulerCodes(self):
|
def ListSchedulerCodes(self):
|
||||||
"""
|
"""
|
||||||
Returns a list of all defined Rivendell schedule codes
|
Returns a list of all defined Rivendell schedule codes
|
||||||
(list of dictionaries)
|
(list of rivwebpyapi.SchedulerCode objects).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -1625,14 +1632,15 @@ class rivwebpyapi(object):
|
|||||||
#
|
#
|
||||||
# Generate the output dictionary
|
# Generate the output dictionary
|
||||||
#
|
#
|
||||||
fields={
|
handler=RivWebPyApi_ListHandler(base_tag='schedCode',
|
||||||
'code': 'string',
|
fields=SCHEDULER_CODE_FIELDS)
|
||||||
'description': 'string'
|
|
||||||
}
|
|
||||||
handler=RivWebPyApi_ListHandler(base_tag='schedCode',fields=fields)
|
|
||||||
xml.sax.parseString(r.text,handler)
|
xml.sax.parseString(r.text,handler)
|
||||||
|
out=handler.output()
|
||||||
|
ret=[]
|
||||||
|
for item in out:
|
||||||
|
ret.append(SchedulerCode(item))
|
||||||
|
|
||||||
return handler.output()
|
return ret
|
||||||
|
|
||||||
def ListServices(self,trackable):
|
def ListServices(self,trackable):
|
||||||
"""
|
"""
|
||||||
@ -2161,12 +2169,6 @@ class rivwebpyapi(object):
|
|||||||
if(r.status_code!=requests.codes.ok):
|
if(r.status_code!=requests.codes.ok):
|
||||||
self.__throwError(response=r)
|
self.__throwError(response=r)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def SavePodcast(self,cast_id,filename):
|
def SavePodcast(self,cast_id,filename):
|
||||||
"""
|
"""
|
||||||
Save posted podcast audio to the Rivendell audio store.
|
Save posted podcast audio to the Rivendell audio store.
|
||||||
|
@ -77,6 +77,6 @@ except rivwebpyapi.RivWebPyError as err:
|
|||||||
# Display the code list
|
# Display the code list
|
||||||
#
|
#
|
||||||
for code in codes:
|
for code in codes:
|
||||||
print('code: '+str(code['code']))
|
for key in code.values():
|
||||||
print('description: '+str(code['description']))
|
print(key+': '+str(code.values()[key]))
|
||||||
print('')
|
print('')
|
||||||
|
@ -72,6 +72,6 @@ except rivwebpyapi.RivWebPyError as err:
|
|||||||
# Display the code list
|
# Display the code list
|
||||||
#
|
#
|
||||||
for code in codes:
|
for code in codes:
|
||||||
print('code: '+str(code['code']))
|
for key in code.values():
|
||||||
print('description: '+str(code['description']))
|
print(key+': '+str(code.values()[key]))
|
||||||
print('')
|
print('')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user