mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-19 00:51:13 +02:00
2021-12-07 Fred Gleason <fredg@paravelsystems.com>
* Added a 'RivWebPyError' exception type to the 'rivwebpyapi' API. * Modified the 'rivwebpyapi.AddCart()' method to return a single dictionary. * Modified the 'rivwebpyapi.AddCut()' method to return a single dictionary. * Modified the 'rivwebpyapi.AudioInfo()' method to return a single dictionary. * Modified the 'rivwebpyapi.AssignSchedCode()' method to return a single dictionary. * Modified the 'rivwebpyapi.AudioStore()' method to return a single dictionary. * Modified the 'rivwebpyapi.ListCart()' method to return a single dictionary. * Modified the 'rivwebpyapi.ListCut()' method to return a single dictionary. * Modified the 'rivwebpyapi.ListGroup()' method to return a single dictionary. * Modified the 'rivwebpyapi.ListSystemSettings()' method to return a single dictionary. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -25,6 +25,8 @@
|
||||
import getpass
|
||||
import rivwebpyapi
|
||||
import sys
|
||||
def eprint(*args,**kwargs):
|
||||
print(*args,file=sys.stderr,**kwargs)
|
||||
|
||||
url='';
|
||||
username=''
|
||||
@@ -55,22 +57,35 @@ if(not password):
|
||||
if((not url)or(not username)):
|
||||
print(usage)
|
||||
sys.exit(1)
|
||||
if(cart_number==0):
|
||||
eprint('you must supply "--cart-number"')
|
||||
sys.exit(1)
|
||||
if(cut_number==0):
|
||||
eprint('you must supply "--cut-number"')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Get the code list
|
||||
#
|
||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||
infos=webapi.AudioInfo(cart_number=cart_number,cut_number=cut_number)
|
||||
try:
|
||||
info=webapi.AudioInfo(cart_number=cart_number,cut_number=cut_number)
|
||||
except rivwebpyapi.RivWebPyError as err:
|
||||
print('*** ERROR ***')
|
||||
print('Response Code: '+str(err.responseCode))
|
||||
print('ErrorString: '+str(err.errorString))
|
||||
print('*************')
|
||||
print('')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Display the settings list
|
||||
#
|
||||
for info in infos:
|
||||
print('cartNumber: '+str(info['cartNumber']))
|
||||
print('cutNumber: '+str(info['cutNumber']))
|
||||
print('format: '+str(info['format']))
|
||||
print('channels: '+str(info['channels']))
|
||||
print('sampleRate: '+str(info['sampleRate']))
|
||||
print('bitRate: '+str(info['bitRate']))
|
||||
print('frames: '+str(info['frames']))
|
||||
print('length: '+str(info['length']))
|
||||
print('cartNumber: '+str(info['cartNumber']))
|
||||
print('cutNumber: '+str(info['cutNumber']))
|
||||
print('format: '+str(info['format']))
|
||||
print('channels: '+str(info['channels']))
|
||||
print('sampleRate: '+str(info['sampleRate']))
|
||||
print('bitRate: '+str(info['bitRate']))
|
||||
print('frames: '+str(info['frames']))
|
||||
print('length: '+str(info['length']))
|
||||
|
Reference in New Issue
Block a user