mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-06-04 06:02:40 +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:
parent
61d3b9a19b
commit
9d4e6bbf2c
20
ChangeLog
20
ChangeLog
@ -22688,3 +22688,23 @@
|
||||
* Added an 'ExportPeaks()' method to the 'rivwebpyapi' API.
|
||||
2021-12-07 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added an 'Import()' method to the 'rivwebpyapi' API.
|
||||
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.
|
||||
|
@ -191,6 +191,11 @@ class RivWebPyApi_ListHandler(ContentHandler):
|
||||
second=int(time_parts[2]),
|
||||
microsecond=1000*msecs)
|
||||
|
||||
class RivWebPyError(Exception):
|
||||
def __init__(self,resp_body,resp_code):
|
||||
self.errorString=resp_body
|
||||
self.responseCode=resp_code
|
||||
|
||||
class rivwebpyapi(object):
|
||||
"""
|
||||
Create a 'RivWebPyApi' object for accessing the Web API.
|
||||
@ -222,10 +227,24 @@ class rivwebpyapi(object):
|
||||
self.__connection_username=username
|
||||
self.__connection_password=password
|
||||
|
||||
def __throwError(self,response):
|
||||
if(response.headers['content-type']=='application/xml'):
|
||||
fields={
|
||||
'ResponseCode': 'integer',
|
||||
'ErrorString': 'string'
|
||||
}
|
||||
handler=RivWebPyApi_ListHandler(base_tag='RDWebResult',fields=fields)
|
||||
xml.sax.parseString(response.text,handler)
|
||||
output=handler.output();
|
||||
if((len(output)==1)and('ErrorString' in output[0])):
|
||||
raise RivWebPyError(resp_body=output[0]['ErrorString'],
|
||||
resp_code=response.status_code)
|
||||
response.raise_for_status()
|
||||
|
||||
def AddCart(self,group_name,cart_type,cart_number=0):
|
||||
"""
|
||||
Add a new cart to the cart library. Returns the metadata of
|
||||
the newly created cart (list of dictionaries).
|
||||
the newly created cart (dictionary).
|
||||
|
||||
Takes the following arguments:
|
||||
|
||||
@ -258,13 +277,13 @@ class rivwebpyapi(object):
|
||||
}
|
||||
if(cart_number>0):
|
||||
postdata['CART_NUMBER']=str(cart_number)
|
||||
print('ARGS: '+str(postdata))
|
||||
|
||||
#
|
||||
# Fetch the XML
|
||||
#
|
||||
r=requests.post(self.__connection_url,data=postdata)
|
||||
if(r.status_code!=requests.codes.ok):
|
||||
r.raise_for_status()
|
||||
self.__throwError(response=r)
|
||||
|
||||
#
|
||||
# Generate the output dictionary
|
||||
@ -303,12 +322,12 @@ class rivwebpyapi(object):
|
||||
handler=RivWebPyApi_ListHandler(base_tag='cart',fields=fields)
|
||||
xml.sax.parseString(r.text,handler)
|
||||
|
||||
return handler.output()
|
||||
return handler.output()[0]
|
||||
|
||||
def AddCut(self,cart_number):
|
||||
"""
|
||||
Add a new cut to an existing audio cart. Returns the metadata of
|
||||
the newly created cut (list of dictionaries).
|
||||
the newly created cut (dictionary).
|
||||
|
||||
Takes the following argument:
|
||||
|
||||
@ -335,7 +354,7 @@ class rivwebpyapi(object):
|
||||
#
|
||||
r=requests.post(self.__connection_url,data=postdata)
|
||||
if(r.status_code!=requests.codes.ok):
|
||||
r.raise_for_status()
|
||||
self.__throwError(response=r)
|
||||
|
||||
#
|
||||
# Generate the output dictionary
|
||||
@ -390,7 +409,7 @@ class rivwebpyapi(object):
|
||||
handler=RivWebPyApi_ListHandler(base_tag='cut',fields=fields)
|
||||
xml.sax.parseString(r.text,handler)
|
||||
|
||||
return handler.output()
|
||||
return handler.output()[0]
|
||||
|
||||
def AddLog(self,service_name,log_name):
|
||||
"""
|
||||
@ -425,7 +444,7 @@ class rivwebpyapi(object):
|
||||
#
|
||||
r=requests.post(self.__connection_url,data=postdata)
|
||||
if(r.status_code!=requests.codes.ok):
|
||||
r.raise_for_status()
|
||||
self.__throwError(response=r)
|
||||
|
||||
def AssignSchedCode(self,cart_number,sched_code):
|
||||
"""
|
||||
@ -460,12 +479,12 @@ class rivwebpyapi(object):
|
||||
#
|
||||
r=requests.post(self.__connection_url,data=postdata)
|
||||
if(r.status_code!=requests.codes.ok):
|
||||
r.raise_for_status()
|
||||
self.__throwError(response=r)
|
||||
|
||||
def AudioInfo(self,cart_number,cut_number):
|
||||
"""
|
||||
Get information about an entry in the Rivendell audio store
|
||||
(list of dictionaries).
|
||||
(dictionary).
|
||||
|
||||
cart_number - The number of the desired cart, in the range
|
||||
1 - 999999 (integer)
|
||||
@ -495,7 +514,7 @@ class rivwebpyapi(object):
|
||||
#
|
||||
r=requests.post(self.__connection_url,data=postdata)
|
||||
if(r.status_code!=requests.codes.ok):
|
||||
r.raise_for_status()
|
||||
self.__throwError(response=r)
|
||||
|
||||
#
|
||||
# Generate the output dictionary
|
||||
@ -513,11 +532,11 @@ class rivwebpyapi(object):
|
||||
handler=RivWebPyApi_ListHandler(base_tag='audioInfo',fields=fields)
|
||||
xml.sax.parseString(r.text,handler)
|
||||
|
||||
return handler.output()
|
||||
return handler.output()[0]
|
||||
|
||||
def AudioStore(self):
|
||||
"""
|
||||
Get information about the audio store (list of dictionaries).
|
||||
Get information about the audio store (dictionary).
|
||||
"""
|
||||
|
||||
#
|
||||
@ -534,7 +553,7 @@ class rivwebpyapi(object):
|
||||
#
|
||||
r=requests.post(self.__connection_url,data=postdata)
|
||||
if(r.status_code!=requests.codes.ok):
|
||||
r.raise_for_status()
|
||||
self.__throwError(response=r)
|
||||
|
||||
#
|
||||
# Generate the output dictionary
|
||||
@ -546,7 +565,7 @@ class rivwebpyapi(object):
|
||||
handler=RivWebPyApi_ListHandler(base_tag='audioStore',fields=fields)
|
||||
xml.sax.parseString(r.text,handler)
|
||||
|
||||
return handler.output()
|
||||
return handler.output()[0]
|
||||
|
||||
def DeleteAudio(self,cart_number,cut_number):
|
||||
"""
|
||||
@ -580,7 +599,7 @@ class rivwebpyapi(object):
|
||||
#
|
||||
r=requests.post(self.__connection_url,data=postdata)
|
||||
if(r.status_code!=requests.codes.ok):
|
||||
r.raise_for_status()
|
||||
self.__throwError(response=r)
|
||||
|
||||
#
|
||||
# Generate the output dictionary
|
||||
@ -627,7 +646,7 @@ class rivwebpyapi(object):
|
||||
#
|
||||
r=requests.post(self.__connection_url,data=postdata)
|
||||
if(r.status_code!=requests.codes.ok):
|
||||
r.raise_for_status()
|
||||
self.__throwError(response=r)
|
||||
|
||||
def Export(self,filename,cart_number,cut_number,audio_format,channels,
|
||||
sample_rate,bit_rate,quality,start_point,end_point,
|
||||
@ -702,7 +721,7 @@ class rivwebpyapi(object):
|
||||
#
|
||||
r=requests.post(self.__connection_url,data=postdata,stream=True)
|
||||
if(r.status_code!=requests.codes.ok):
|
||||
r.raise_for_status()
|
||||
self.__throwError(response=r)
|
||||
with open(filename,'wb') as handle:
|
||||
for block in r.iter_content(1024):
|
||||
handle.write(block)
|
||||
@ -741,7 +760,7 @@ class rivwebpyapi(object):
|
||||
#
|
||||
r=requests.post(self.__connection_url,data=postdata,stream=True)
|
||||
if(r.status_code!=requests.codes.ok):
|
||||
r.raise_for_status()
|
||||
self.__throwError(response=r)
|
||||
ret=bytes()
|
||||
for block in r.iter_content(chunk_size=1024):
|
||||
ret=ret+block
|
||||
@ -823,12 +842,12 @@ class rivwebpyapi(object):
|
||||
#
|
||||
r=requests.post(self.__connection_url,data=postdata,files=files)
|
||||
if(r.status_code!=requests.codes.ok):
|
||||
r.raise_for_status()
|
||||
self.__throwError(response=r)
|
||||
|
||||
def ListCart(self,cart_number,include_cuts=False):
|
||||
"""
|
||||
Returns the metadata associated with a Rivendell cart
|
||||
(list of dictionaries).
|
||||
(dictionary).
|
||||
|
||||
Takes the following arguments:
|
||||
|
||||
@ -860,7 +879,7 @@ class rivwebpyapi(object):
|
||||
#
|
||||
r=requests.post(self.__connection_url,data=postdata)
|
||||
if(r.status_code!=requests.codes.ok):
|
||||
r.raise_for_status()
|
||||
self.__throwError(response=r)
|
||||
|
||||
#
|
||||
# Generate the output dictionary
|
||||
@ -899,7 +918,7 @@ class rivwebpyapi(object):
|
||||
handler=RivWebPyApi_ListHandler(base_tag='cart',fields=fields)
|
||||
xml.sax.parseString(r.text,handler)
|
||||
|
||||
return handler.output()
|
||||
return handler.output()[0]
|
||||
|
||||
def ListCarts(self,group_name='',filter_string='',cart_type='all',
|
||||
include_cuts=False):
|
||||
@ -945,7 +964,7 @@ class rivwebpyapi(object):
|
||||
#
|
||||
r=requests.post(self.__connection_url,data=postdata)
|
||||
if(r.status_code!=requests.codes.ok):
|
||||
r.raise_for_status()
|
||||
self.__throwError(response=r)
|
||||
|
||||
#
|
||||
# Generate the output dictionary
|
||||
@ -1016,7 +1035,7 @@ class rivwebpyapi(object):
|
||||
#
|
||||
r=requests.post(self.__connection_url,data=postdata)
|
||||
if(r.status_code!=requests.codes.ok):
|
||||
r.raise_for_status()
|
||||
self.__throwError(response=r)
|
||||
|
||||
#
|
||||
# Generate the output dictionary
|
||||
@ -1033,7 +1052,7 @@ class rivwebpyapi(object):
|
||||
def ListCut(self,cart_number,cut_number):
|
||||
"""
|
||||
Returns the metadata associated with a Rivendell cut
|
||||
(list of dictionaries).
|
||||
(dictionary).
|
||||
|
||||
Takes the following arguments:
|
||||
|
||||
@ -1065,7 +1084,7 @@ class rivwebpyapi(object):
|
||||
#
|
||||
r=requests.post(self.__connection_url,data=postdata)
|
||||
if(r.status_code!=requests.codes.ok):
|
||||
r.raise_for_status()
|
||||
self.__throwError(response=r)
|
||||
|
||||
#
|
||||
# Generate the output dictionary
|
||||
@ -1120,7 +1139,7 @@ class rivwebpyapi(object):
|
||||
handler=RivWebPyApi_ListHandler(base_tag='cut',fields=fields)
|
||||
xml.sax.parseString(r.text,handler)
|
||||
|
||||
return handler.output()
|
||||
return handler.output()[0]
|
||||
|
||||
def ListCuts(self,cart_number):
|
||||
"""
|
||||
@ -1152,7 +1171,7 @@ class rivwebpyapi(object):
|
||||
#
|
||||
r=requests.post(self.__connection_url,data=postdata)
|
||||
if(r.status_code!=requests.codes.ok):
|
||||
r.raise_for_status()
|
||||
self.__throwError(response=r)
|
||||
|
||||
#
|
||||
# Generate the output dictionary
|
||||
@ -1211,7 +1230,7 @@ class rivwebpyapi(object):
|
||||
|
||||
def ListGroup(self,group_name):
|
||||
"""
|
||||
Returns a Rivendell group (list of dictionaries).
|
||||
Returns a Rivendell group (dictionary).
|
||||
|
||||
Takes the following argument:
|
||||
|
||||
@ -1234,7 +1253,7 @@ class rivwebpyapi(object):
|
||||
#
|
||||
r=requests.post(self.__connection_url,data=postdata)
|
||||
if(r.status_code!=requests.codes.ok):
|
||||
r.raise_for_status()
|
||||
self.__throwError(response=r)
|
||||
|
||||
#
|
||||
# Generate the output dictionary
|
||||
@ -1255,7 +1274,7 @@ class rivwebpyapi(object):
|
||||
handler=RivWebPyApi_ListHandler(base_tag='group',fields=fields)
|
||||
xml.sax.parseString(r.text,handler)
|
||||
|
||||
return handler.output()
|
||||
return handler.output()[0]
|
||||
|
||||
def ListGroups(self):
|
||||
"""
|
||||
@ -1276,7 +1295,7 @@ class rivwebpyapi(object):
|
||||
#
|
||||
r=requests.post(self.__connection_url,data=postdata)
|
||||
if(r.status_code!=requests.codes.ok):
|
||||
r.raise_for_status()
|
||||
self.__throwError(response=r)
|
||||
|
||||
#
|
||||
# Generate the output dictionary
|
||||
@ -1323,7 +1342,7 @@ class rivwebpyapi(object):
|
||||
#
|
||||
r=requests.post(self.__connection_url,data=postdata)
|
||||
if(r.status_code!=requests.codes.ok):
|
||||
r.raise_for_status()
|
||||
self.__throwError(response=r)
|
||||
|
||||
#
|
||||
# Generate the output dictionary
|
||||
@ -1458,7 +1477,7 @@ class rivwebpyapi(object):
|
||||
#
|
||||
r=requests.post(self.__connection_url,data=postdata)
|
||||
if(r.status_code!=requests.codes.ok):
|
||||
r.raise_for_status()
|
||||
self.__throwError(response=r)
|
||||
|
||||
#
|
||||
# Generate the output dictionary
|
||||
@ -1507,7 +1526,7 @@ class rivwebpyapi(object):
|
||||
#
|
||||
r=requests.post(self.__connection_url,data=postdata)
|
||||
if(r.status_code!=requests.codes.ok):
|
||||
r.raise_for_status()
|
||||
self.__throwError(response=r)
|
||||
|
||||
#
|
||||
# Generate the output dictionary
|
||||
@ -1551,7 +1570,7 @@ class rivwebpyapi(object):
|
||||
#
|
||||
r=requests.post(self.__connection_url,data=postdata)
|
||||
if(r.status_code!=requests.codes.ok):
|
||||
r.raise_for_status()
|
||||
self.__throwError(response=r)
|
||||
|
||||
#
|
||||
# Generate the output dictionary
|
||||
@ -1567,7 +1586,7 @@ class rivwebpyapi(object):
|
||||
|
||||
def ListSystemSettings(self):
|
||||
"""
|
||||
Returns Rivendell system settings (list of dictionaries).
|
||||
Returns Rivendell system settings (dictionary).
|
||||
"""
|
||||
|
||||
#
|
||||
@ -1584,7 +1603,7 @@ class rivwebpyapi(object):
|
||||
#
|
||||
r=requests.post(self.__connection_url,data=postdata)
|
||||
if(r.status_code!=requests.codes.ok):
|
||||
r.raise_for_status()
|
||||
self.__throwError(response=r)
|
||||
|
||||
#
|
||||
# Generate the output dictionary
|
||||
@ -1604,7 +1623,7 @@ class rivwebpyapi(object):
|
||||
handler=RivWebPyApi_ListHandler(base_tag='systemSettings',fields=fields)
|
||||
xml.sax.parseString(r.text,handler)
|
||||
|
||||
return handler.output()
|
||||
return handler.output()[0]
|
||||
|
||||
def RemoveCart(self,cart_number):
|
||||
"""
|
||||
@ -1634,16 +1653,7 @@ class rivwebpyapi(object):
|
||||
#
|
||||
r=requests.post(self.__connection_url,data=postdata)
|
||||
if(r.status_code!=requests.codes.ok):
|
||||
r.raise_for_status()
|
||||
|
||||
#
|
||||
# Generate the output dictionary
|
||||
#
|
||||
fields={
|
||||
'ResponseCode': 'integer',
|
||||
'ErrorString': 'string'
|
||||
}
|
||||
handler=RivWebPyApi_ListHandler(base_tag='RDWebResult',fields=fields)
|
||||
self.__throwError(response=r)
|
||||
|
||||
def RemoveCut(self,cart_number,cut_number):
|
||||
"""
|
||||
@ -1679,16 +1689,7 @@ class rivwebpyapi(object):
|
||||
#
|
||||
r=requests.post(self.__connection_url,data=postdata)
|
||||
if(r.status_code!=requests.codes.ok):
|
||||
r.raise_for_status()
|
||||
|
||||
#
|
||||
# Generate the output dictionary
|
||||
#
|
||||
fields={
|
||||
'ResponseCode': 'integer',
|
||||
'ErrorString': 'string'
|
||||
}
|
||||
handler=RivWebPyApi_ListHandler(base_tag='RDWebResult',fields=fields)
|
||||
self.__throwError(response=r)
|
||||
|
||||
def UnassignSchedCode(self,cart_number,sched_code):
|
||||
"""
|
||||
@ -1723,4 +1724,4 @@ class rivwebpyapi(object):
|
||||
#
|
||||
r=requests.post(self.__connection_url,data=postdata)
|
||||
if(r.status_code!=requests.codes.ok):
|
||||
r.raise_for_status()
|
||||
self.__throwError(response=r)
|
||||
|
@ -25,12 +25,14 @@
|
||||
import getpass
|
||||
import rivwebpyapi
|
||||
import sys
|
||||
def eprint(*args,**kwargs):
|
||||
print(*args,file=sys.stderr,**kwargs)
|
||||
|
||||
url='';
|
||||
username=''
|
||||
password=''
|
||||
cart_number=0
|
||||
cart_type='audio'
|
||||
cart_type=''
|
||||
group_name=''
|
||||
|
||||
#
|
||||
@ -56,47 +58,63 @@ for arg in sys.argv:
|
||||
if(not password):
|
||||
password=getpass.getpass()
|
||||
if((not url)or(not username)):
|
||||
print(usage)
|
||||
eprint(usage)
|
||||
sys.exit(1)
|
||||
if(not group_name):
|
||||
eprint('you must supply "--group-name"')
|
||||
sys.exit(1)
|
||||
if(not cart_type):
|
||||
eprint('you must supply "--cart-type"')
|
||||
sys.exit(1)
|
||||
if(cart_number==0):
|
||||
eprint('you must supply "--cart-number"')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Get the cut list
|
||||
#
|
||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||
carts=webapi.AddCart(group_name=group_name,cart_type=cart_type,cart_number=cart_number)
|
||||
try:
|
||||
cart=webapi.AddCart(group_name=group_name,cart_type=cart_type,cart_number=cart_number)
|
||||
except rivwebpyapi.RivWebPyError as err:
|
||||
eprint('*** ERROR ***')
|
||||
eprint('Response Code: '+str(err.responseCode))
|
||||
eprint('ErrorString: '+str(err.errorString))
|
||||
eprint('*************')
|
||||
eprint('')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Display the cart list
|
||||
#
|
||||
for cart in carts:
|
||||
print('ADDED')
|
||||
print('number: '+str(cart['number']))
|
||||
print('type: '+str(cart['type']))
|
||||
print('groupName: '+str(cart['groupName']))
|
||||
print('title: '+str(cart['title']))
|
||||
print('artist: '+str(cart['artist']))
|
||||
print('album: '+str(cart['album']))
|
||||
print('year: '+str(cart['year']))
|
||||
print('label: '+str(cart['label']))
|
||||
print('client: '+str(cart['client']))
|
||||
print('agency: '+str(cart['agency']))
|
||||
print('publisher: '+str(cart['publisher']))
|
||||
print('composer: '+str(cart['composer']))
|
||||
print('conductor: '+str(cart['conductor']))
|
||||
print('userDefined: '+str(cart['userDefined']))
|
||||
print('usageCode: '+str(cart['usageCode']))
|
||||
print('forcedLength: '+str(cart['forcedLength']))
|
||||
print('averageLength: '+str(cart['averageLength']))
|
||||
print('lengthDeviation: '+str(cart['lengthDeviation']))
|
||||
print('averageSegueLength: '+str(cart['averageSegueLength']))
|
||||
print('averageHookLength: '+str(cart['averageHookLength']))
|
||||
print('minimumTalkLength: '+str(cart['minimumTalkLength']))
|
||||
print('maximumTalkLength: '+str(cart['maximumTalkLength']))
|
||||
print('cutQuantity: '+str(cart['cutQuantity']))
|
||||
print('lastCutPlayed: '+str(cart['lastCutPlayed']))
|
||||
print('enforceLength: '+str(cart['enforceLength']))
|
||||
print('asyncronous: '+str(cart['asyncronous']))
|
||||
print('owner: '+str(cart['owner']))
|
||||
print('metadataDatetime: '+str(cart['metadataDatetime']))
|
||||
print('songId: '+str(cart['songId']))
|
||||
print('')
|
||||
print('ADDED')
|
||||
print('number: '+str(cart['number']))
|
||||
print('type: '+str(cart['type']))
|
||||
print('groupName: '+str(cart['groupName']))
|
||||
print('title: '+str(cart['title']))
|
||||
print('artist: '+str(cart['artist']))
|
||||
print('album: '+str(cart['album']))
|
||||
print('year: '+str(cart['year']))
|
||||
print('label: '+str(cart['label']))
|
||||
print('client: '+str(cart['client']))
|
||||
print('agency: '+str(cart['agency']))
|
||||
print('publisher: '+str(cart['publisher']))
|
||||
print('composer: '+str(cart['composer']))
|
||||
print('conductor: '+str(cart['conductor']))
|
||||
print('userDefined: '+str(cart['userDefined']))
|
||||
print('usageCode: '+str(cart['usageCode']))
|
||||
print('forcedLength: '+str(cart['forcedLength']))
|
||||
print('averageLength: '+str(cart['averageLength']))
|
||||
print('lengthDeviation: '+str(cart['lengthDeviation']))
|
||||
print('averageSegueLength: '+str(cart['averageSegueLength']))
|
||||
print('averageHookLength: '+str(cart['averageHookLength']))
|
||||
print('minimumTalkLength: '+str(cart['minimumTalkLength']))
|
||||
print('maximumTalkLength: '+str(cart['maximumTalkLength']))
|
||||
print('cutQuantity: '+str(cart['cutQuantity']))
|
||||
print('lastCutPlayed: '+str(cart['lastCutPlayed']))
|
||||
print('enforceLength: '+str(cart['enforceLength']))
|
||||
print('asyncronous: '+str(cart['asyncronous']))
|
||||
print('owner: '+str(cart['owner']))
|
||||
print('metadataDatetime: '+str(cart['metadataDatetime']))
|
||||
print('songId: '+str(cart['songId']))
|
||||
print('')
|
||||
|
@ -25,6 +25,8 @@
|
||||
import getpass
|
||||
import rivwebpyapi
|
||||
import sys
|
||||
def eprint(*args,**kwargs):
|
||||
print(*args,file=sys.stderr,**kwargs)
|
||||
|
||||
url='';
|
||||
username=''
|
||||
@ -51,62 +53,72 @@ for arg in sys.argv:
|
||||
if(not password):
|
||||
password=getpass.getpass()
|
||||
if((not url)or(not username)):
|
||||
print(usage)
|
||||
eprint(usage)
|
||||
sys.exit(1)
|
||||
if(not cart_number):
|
||||
eprint('you must supply "--cart-number"')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Get the cut list
|
||||
#
|
||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||
cuts=webapi.AddCut(cart_number=cart_number)
|
||||
try:
|
||||
cut=webapi.AddCut(cart_number=cart_number)
|
||||
except rivwebpyapi.RivWebPyError as err:
|
||||
eprint('*** ERROR ***')
|
||||
eprint('Response Code: '+str(err.responseCode))
|
||||
eprint('ErrorString: '+str(err.errorString))
|
||||
eprint('*************')
|
||||
eprint('')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Display the cut list
|
||||
# Display the cut
|
||||
#
|
||||
for cut in cuts:
|
||||
print('ADDED:')
|
||||
print('cutName: '+str(cut['cutName']))
|
||||
print('cartNumber: '+str(cut['cartNumber']))
|
||||
print('cutNumber: '+str(cut['cutNumber']))
|
||||
print('evergreen: '+str(cut['evergreen']))
|
||||
print('description: '+str(cut['description']))
|
||||
print('outcue: '+str(cut['outcue']))
|
||||
print('isrc: '+str(cut['isrc']))
|
||||
print('isci: '+str(cut['isci']))
|
||||
print('recordingMbId: '+str(cut['recordingMbId']))
|
||||
print('releaseMbId: '+str(cut['releaseMbId']))
|
||||
print('length: '+str(cut['length']))
|
||||
print('originDatetime: '+str(cut['originDatetime']))
|
||||
print('startDatetime: '+str(cut['startDatetime']))
|
||||
print('endDatetime: '+str(cut['endDatetime']))
|
||||
print('sun: '+str(cut['sun']))
|
||||
print('mon: '+str(cut['mon']))
|
||||
print('tue: '+str(cut['tue']))
|
||||
print('wed: '+str(cut['wed']))
|
||||
print('thu: '+str(cut['thu']))
|
||||
print('fri: '+str(cut['fri']))
|
||||
print('sat: '+str(cut['sat']))
|
||||
print('startDaypart: '+str(cut['startDaypart']))
|
||||
print('endDaypart: '+str(cut['endDaypart']))
|
||||
print('originName: '+str(cut['originName']))
|
||||
print('originLoginName: '+str(cut['originLoginName']))
|
||||
print('sourceHostname: '+str(cut['sourceHostname']))
|
||||
print('weight: '+str(cut['weight']))
|
||||
print('lastPlayDatetime: '+str(cut['lastPlayDatetime']))
|
||||
print('playCounter: '+str(cut['playCounter']))
|
||||
print('codingFormat: '+str(cut['codingFormat']))
|
||||
print('sampleRate: '+str(cut['sampleRate']))
|
||||
print('bitRate: '+str(cut['bitRate']))
|
||||
print('channels: '+str(cut['channels']))
|
||||
print('playGain: '+str(cut['playGain']))
|
||||
print('startPoint: '+str(cut['startPoint']))
|
||||
print('endPoint: '+str(cut['endPoint']))
|
||||
print('fadeupPoint: '+str(cut['fadeupPoint']))
|
||||
print('fadedownPoint: '+str(cut['fadedownPoint']))
|
||||
print('segueStartPoint: '+str(cut['segueStartPoint']))
|
||||
print('segueEndPoint: '+str(cut['segueEndPoint']))
|
||||
print('segueGain: '+str(cut['segueGain']))
|
||||
print('hookStartPoint: '+str(cut['hookStartPoint']))
|
||||
print('hookEndPoint: '+str(cut['hookEndPoint']))
|
||||
print('talkStartPoint: '+str(cut['talkStartPoint']))
|
||||
print('talkEndPoint: '+str(cut['talkEndPoint']))
|
||||
print('ADDED:')
|
||||
print('cutName: '+str(cut['cutName']))
|
||||
print('cartNumber: '+str(cut['cartNumber']))
|
||||
print('cutNumber: '+str(cut['cutNumber']))
|
||||
print('evergreen: '+str(cut['evergreen']))
|
||||
print('description: '+str(cut['description']))
|
||||
print('outcue: '+str(cut['outcue']))
|
||||
print('isrc: '+str(cut['isrc']))
|
||||
print('isci: '+str(cut['isci']))
|
||||
print('recordingMbId: '+str(cut['recordingMbId']))
|
||||
print('releaseMbId: '+str(cut['releaseMbId']))
|
||||
print('length: '+str(cut['length']))
|
||||
print('originDatetime: '+str(cut['originDatetime']))
|
||||
print('startDatetime: '+str(cut['startDatetime']))
|
||||
print('endDatetime: '+str(cut['endDatetime']))
|
||||
print('sun: '+str(cut['sun']))
|
||||
print('mon: '+str(cut['mon']))
|
||||
print('tue: '+str(cut['tue']))
|
||||
print('wed: '+str(cut['wed']))
|
||||
print('thu: '+str(cut['thu']))
|
||||
print('fri: '+str(cut['fri']))
|
||||
print('sat: '+str(cut['sat']))
|
||||
print('startDaypart: '+str(cut['startDaypart']))
|
||||
print('endDaypart: '+str(cut['endDaypart']))
|
||||
print('originName: '+str(cut['originName']))
|
||||
print('originLoginName: '+str(cut['originLoginName']))
|
||||
print('sourceHostname: '+str(cut['sourceHostname']))
|
||||
print('weight: '+str(cut['weight']))
|
||||
print('lastPlayDatetime: '+str(cut['lastPlayDatetime']))
|
||||
print('playCounter: '+str(cut['playCounter']))
|
||||
print('codingFormat: '+str(cut['codingFormat']))
|
||||
print('sampleRate: '+str(cut['sampleRate']))
|
||||
print('bitRate: '+str(cut['bitRate']))
|
||||
print('channels: '+str(cut['channels']))
|
||||
print('playGain: '+str(cut['playGain']))
|
||||
print('startPoint: '+str(cut['startPoint']))
|
||||
print('endPoint: '+str(cut['endPoint']))
|
||||
print('fadeupPoint: '+str(cut['fadeupPoint']))
|
||||
print('fadedownPoint: '+str(cut['fadedownPoint']))
|
||||
print('segueStartPoint: '+str(cut['segueStartPoint']))
|
||||
print('segueEndPoint: '+str(cut['segueEndPoint']))
|
||||
print('segueGain: '+str(cut['segueGain']))
|
||||
print('hookStartPoint: '+str(cut['hookStartPoint']))
|
||||
print('hookEndPoint: '+str(cut['hookEndPoint']))
|
||||
print('talkStartPoint: '+str(cut['talkStartPoint']))
|
||||
print('talkEndPoint: '+str(cut['talkEndPoint']))
|
||||
|
@ -25,6 +25,8 @@
|
||||
import getpass
|
||||
import rivwebpyapi
|
||||
import sys
|
||||
def eprint(*args,**kwargs):
|
||||
print(*args,file=sys.stderr,**kwargs)
|
||||
|
||||
url='';
|
||||
username=''
|
||||
@ -35,7 +37,7 @@ log_name=''
|
||||
#
|
||||
# Get login parameters
|
||||
#
|
||||
usage='add_log --url=<rd-url> --username=<rd-username> --cart-number=<num> [--password=<passwd>]'
|
||||
usage='add_log --url=<rd-url> --username=<rd-username> --service-name=<str> --log-name=<str> [--password=<passwd>]'
|
||||
for arg in sys.argv:
|
||||
f0=arg.split('=')
|
||||
if(len(f0)==2):
|
||||
@ -53,11 +55,25 @@ for arg in sys.argv:
|
||||
if(not password):
|
||||
password=getpass.getpass()
|
||||
if((not url)or(not username)):
|
||||
print(usage)
|
||||
eprint(usage)
|
||||
sys.exit(1)
|
||||
if(not log_name):
|
||||
eprint('you must supply "--log-name"')
|
||||
sys.exit(1)
|
||||
if(not service_name):
|
||||
eprint('you must supply "--service-name"')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Execute
|
||||
#
|
||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||
webapi.AddLog(service_name=service_name,log_name=log_name)
|
||||
try:
|
||||
webapi.AddLog(service_name=service_name,log_name=log_name)
|
||||
except rivwebpyapi.RivWebPyError as err:
|
||||
eprint('*** ERROR ***')
|
||||
eprint('Response Code: '+str(err.responseCode))
|
||||
eprint('ErrorString: '+str(err.errorString))
|
||||
eprint('*************')
|
||||
eprint('')
|
||||
sys.exit(1)
|
||||
|
@ -25,6 +25,8 @@
|
||||
import getpass
|
||||
import rivwebpyapi
|
||||
import sys
|
||||
def eprint(*args,**kwargs):
|
||||
print(*args,file=sys.stderr,**kwargs)
|
||||
|
||||
url='';
|
||||
username=''
|
||||
@ -53,11 +55,25 @@ for arg in sys.argv:
|
||||
if(not password):
|
||||
password=getpass.getpass()
|
||||
if((not url)or(not username)):
|
||||
print(usage)
|
||||
eprint(usage)
|
||||
sys.exit(1)
|
||||
if(cart_number==0):
|
||||
eprint('you must supply "--cart-number"')
|
||||
sys.exit(1)
|
||||
if(not sched_code):
|
||||
eprint('you must supply "--sched-code"')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Execute
|
||||
#
|
||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||
webapi.AssignSchedCode(cart_number=cart_number,sched_code=sched_code)
|
||||
try:
|
||||
webapi.AssignSchedCode(cart_number=cart_number,sched_code=sched_code)
|
||||
except rivwebpyapi.RivWebPyError as err:
|
||||
eprint('*** ERROR ***')
|
||||
eprint('Response Code: '+str(err.responseCode))
|
||||
eprint('ErrorString: '+str(err.errorString))
|
||||
eprint('*************')
|
||||
eprint('')
|
||||
sys.exit(1)
|
||||
|
@ -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']))
|
||||
|
@ -25,6 +25,8 @@
|
||||
import getpass
|
||||
import rivwebpyapi
|
||||
import sys
|
||||
def eprint(*args,**kwargs):
|
||||
print(*args,file=sys.stderr,**kwargs)
|
||||
|
||||
url='';
|
||||
username=''
|
||||
@ -51,15 +53,22 @@ if((not url)or(not username)):
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Get the code list
|
||||
# Get the settings
|
||||
#
|
||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||
settings=webapi.AudioStore()
|
||||
try:
|
||||
setting=webapi.AudioStore()
|
||||
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 setting in settings:
|
||||
print('freeBytes: '+str(setting['freeBytes']))
|
||||
print('totalBytes: '+str(setting['totalBytes']))
|
||||
print('')
|
||||
print('freeBytes: '+str(setting['freeBytes']))
|
||||
print('totalBytes: '+str(setting['totalBytes']))
|
||||
print('')
|
||||
|
@ -25,6 +25,8 @@
|
||||
import getpass
|
||||
import rivwebpyapi
|
||||
import sys
|
||||
def eprint(*args,**kwargs):
|
||||
print(*args,file=sys.stderr,**kwargs)
|
||||
|
||||
url='';
|
||||
username=''
|
||||
@ -55,9 +57,23 @@ 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)
|
||||
webapi.DeleteAudio(cart_number=cart_number,cut_number=cut_number)
|
||||
try:
|
||||
webapi.DeleteAudio(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)
|
||||
|
@ -25,6 +25,8 @@
|
||||
import getpass
|
||||
import rivwebpyapi
|
||||
import sys
|
||||
def eprint(*args,**kwargs):
|
||||
print(*args,file=sys.stderr,**kwargs)
|
||||
|
||||
url='';
|
||||
username=''
|
||||
@ -50,11 +52,22 @@ for arg in sys.argv:
|
||||
if(not password):
|
||||
password=getpass.getpass()
|
||||
if((not url)or(not username)):
|
||||
print(usage)
|
||||
eprint(usage)
|
||||
sys.exit(1)
|
||||
if(not log_name):
|
||||
eprint('you must supply "--log-name"')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Execute
|
||||
#
|
||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||
webapi.DeleteLog(log_name=log_name)
|
||||
try:
|
||||
webapi.DeleteLog(log_name=log_name)
|
||||
except rivwebpyapi.RivWebPyError as err:
|
||||
eprint('*** ERROR ***')
|
||||
eprint('Response Code: '+str(err.responseCode))
|
||||
eprint('ErrorString: '+str(err.errorString))
|
||||
eprint('*************')
|
||||
eprint('')
|
||||
sys.exit(1)
|
||||
|
@ -25,6 +25,8 @@
|
||||
import getpass
|
||||
import rivwebpyapi
|
||||
import sys
|
||||
def eprint(*args,**kwargs):
|
||||
print(*args,file=sys.stderr,**kwargs)
|
||||
|
||||
url='';
|
||||
username=''
|
||||
@ -32,7 +34,7 @@ password=''
|
||||
filename=''
|
||||
cart_number=0
|
||||
cut_number=0
|
||||
audio_format=0
|
||||
audio_format=-1
|
||||
channels=2
|
||||
sample_rate=48000
|
||||
bit_rate=0
|
||||
@ -84,16 +86,43 @@ for arg in sys.argv:
|
||||
if(not password):
|
||||
password=getpass.getpass()
|
||||
if((not url)or(not username)):
|
||||
print(usage)
|
||||
eprint(usage)
|
||||
sys.exit(1)
|
||||
if(not filename):
|
||||
eprint('you must supply "--filename"')
|
||||
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)
|
||||
if(audio_format<0):
|
||||
eprint('you must supply "--audio-format"')
|
||||
sys.exit(1)
|
||||
if(start_point<0):
|
||||
eprint('you must supply "--start_point"')
|
||||
sys.exit(1)
|
||||
if(end_point<0):
|
||||
eprint('you must supply "--end_point"')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Get the code list
|
||||
#
|
||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||
webapi.Export(filename=filename,cart_number=cart_number,cut_number=cut_number,
|
||||
audio_format=audio_format,channels=channels,
|
||||
sample_rate=sample_rate,bit_rate=bit_rate,quality=quality,
|
||||
start_point=start_point,end_point=end_point,
|
||||
normalization_level=normalization_level,
|
||||
enable_metadata=enable_metadata)
|
||||
try:
|
||||
webapi.Export(filename=filename,cart_number=cart_number,
|
||||
cut_number=cut_number,
|
||||
audio_format=audio_format,channels=channels,
|
||||
sample_rate=sample_rate,bit_rate=bit_rate,quality=quality,
|
||||
start_point=start_point,end_point=end_point,
|
||||
normalization_level=normalization_level,
|
||||
enable_metadata=enable_metadata)
|
||||
except rivwebpyapi.RivWebPyError as err:
|
||||
eprint('*** ERROR ***')
|
||||
eprint('Response Code: '+str(err.responseCode))
|
||||
eprint('ErrorString: '+str(err.errorString))
|
||||
eprint('*************')
|
||||
eprint('')
|
||||
sys.exit(1)
|
||||
|
@ -25,6 +25,8 @@
|
||||
import getpass
|
||||
import rivwebpyapi
|
||||
import sys
|
||||
def eprint(*args,**kwargs):
|
||||
print(*args,file=sys.stderr,**kwargs)
|
||||
|
||||
url='';
|
||||
username=''
|
||||
@ -55,12 +57,26 @@ 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 peak data
|
||||
#
|
||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||
peak_data=webapi.ExportPeaks(cart_number=cart_number,cut_number=cut_number)
|
||||
try:
|
||||
peak_data=webapi.ExportPeaks(cart_number=cart_number,cut_number=cut_number)
|
||||
except rivwebpyapi.RivWebPyError as err:
|
||||
eprint('*** ERROR ***')
|
||||
eprint('Response Code: '+str(err.responseCode))
|
||||
eprint('ErrorString: '+str(err.errorString))
|
||||
eprint('*************')
|
||||
eprint('')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Write to stdout
|
||||
|
@ -25,6 +25,8 @@
|
||||
import getpass
|
||||
import rivwebpyapi
|
||||
import sys
|
||||
def eprint(*args,**kwargs):
|
||||
print(*args,file=sys.stderr,**kwargs)
|
||||
|
||||
url='';
|
||||
username=''
|
||||
@ -77,12 +79,30 @@ 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)
|
||||
if(not filename):
|
||||
eprint('you must supply "--filename"')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Get the code list
|
||||
#
|
||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||
webapi.Import(filename=filename,cart_number=cart_number,cut_number=cut_number,
|
||||
channels=channels,normalization_level=normalization_level,
|
||||
autotrim_level=autotrim_level,use_metadata=use_metadata,
|
||||
group_name=group_name,title=title)
|
||||
try:
|
||||
webapi.Import(filename=filename,cart_number=cart_number,
|
||||
cut_number=cut_number,
|
||||
channels=channels,normalization_level=normalization_level,
|
||||
autotrim_level=autotrim_level,use_metadata=use_metadata,
|
||||
group_name=group_name,title=title)
|
||||
except rivwebpyapi.RivWebPyError as err:
|
||||
eprint('*** ERROR ***')
|
||||
eprint('Response Code: '+str(err.responseCode))
|
||||
eprint('ErrorString: '+str(err.errorString))
|
||||
eprint('*************')
|
||||
eprint('')
|
||||
sys.exit(1)
|
||||
|
@ -25,6 +25,8 @@
|
||||
import getpass
|
||||
import rivwebpyapi
|
||||
import sys
|
||||
def eprint(*args,**kwargs):
|
||||
print(*args,file=sys.stderr,**kwargs)
|
||||
|
||||
url='';
|
||||
username=''
|
||||
@ -53,44 +55,54 @@ 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)
|
||||
|
||||
#
|
||||
# Get the cart list
|
||||
#
|
||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||
carts=webapi.ListCart(cart_number=cart_number,include_cuts=include_cuts)
|
||||
try:
|
||||
cart=webapi.ListCart(cart_number=cart_number,include_cuts=include_cuts)
|
||||
except rivwebpyapi.RivWebPyError as err:
|
||||
eprint('*** ERROR ***')
|
||||
eprint('Response Code: '+str(err.responseCode))
|
||||
eprint('ErrorString: '+str(err.errorString))
|
||||
eprint('*************')
|
||||
eprint('')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Display the cart list
|
||||
#
|
||||
for cart in carts:
|
||||
print('number: '+str(cart['number']))
|
||||
print('type: '+str(cart['type']))
|
||||
print('groupName: '+str(cart['groupName']))
|
||||
print('title: '+str(cart['title']))
|
||||
print('artist: '+str(cart['artist']))
|
||||
print('album: '+str(cart['album']))
|
||||
print('year: '+str(cart['year']))
|
||||
print('label: '+str(cart['label']))
|
||||
print('client: '+str(cart['client']))
|
||||
print('agency: '+str(cart['agency']))
|
||||
print('publisher: '+str(cart['publisher']))
|
||||
print('composer: '+str(cart['composer']))
|
||||
print('conductor: '+str(cart['conductor']))
|
||||
print('userDefined: '+str(cart['userDefined']))
|
||||
print('usageCode: '+str(cart['usageCode']))
|
||||
print('forcedLength: '+str(cart['forcedLength']))
|
||||
print('averageLength: '+str(cart['averageLength']))
|
||||
print('lengthDeviation: '+str(cart['lengthDeviation']))
|
||||
print('averageSegueLength: '+str(cart['averageSegueLength']))
|
||||
print('averageHookLength: '+str(cart['averageHookLength']))
|
||||
print('minimumTalkLength: '+str(cart['minimumTalkLength']))
|
||||
print('maximumTalkLength: '+str(cart['maximumTalkLength']))
|
||||
print('cutQuantity: '+str(cart['cutQuantity']))
|
||||
print('lastCutPlayed: '+str(cart['lastCutPlayed']))
|
||||
print('enforceLength: '+str(cart['enforceLength']))
|
||||
print('asyncronous: '+str(cart['asyncronous']))
|
||||
print('owner: '+str(cart['owner']))
|
||||
print('metadataDatetime: '+str(cart['metadataDatetime']))
|
||||
print('songId: '+str(cart['songId']))
|
||||
print('')
|
||||
print('number: '+str(cart['number']))
|
||||
print('type: '+str(cart['type']))
|
||||
print('groupName: '+str(cart['groupName']))
|
||||
print('title: '+str(cart['title']))
|
||||
print('artist: '+str(cart['artist']))
|
||||
print('album: '+str(cart['album']))
|
||||
print('year: '+str(cart['year']))
|
||||
print('label: '+str(cart['label']))
|
||||
print('client: '+str(cart['client']))
|
||||
print('agency: '+str(cart['agency']))
|
||||
print('publisher: '+str(cart['publisher']))
|
||||
print('composer: '+str(cart['composer']))
|
||||
print('conductor: '+str(cart['conductor']))
|
||||
print('userDefined: '+str(cart['userDefined']))
|
||||
print('usageCode: '+str(cart['usageCode']))
|
||||
print('forcedLength: '+str(cart['forcedLength']))
|
||||
print('averageLength: '+str(cart['averageLength']))
|
||||
print('lengthDeviation: '+str(cart['lengthDeviation']))
|
||||
print('averageSegueLength: '+str(cart['averageSegueLength']))
|
||||
print('averageHookLength: '+str(cart['averageHookLength']))
|
||||
print('minimumTalkLength: '+str(cart['minimumTalkLength']))
|
||||
print('maximumTalkLength: '+str(cart['maximumTalkLength']))
|
||||
print('cutQuantity: '+str(cart['cutQuantity']))
|
||||
print('lastCutPlayed: '+str(cart['lastCutPlayed']))
|
||||
print('enforceLength: '+str(cart['enforceLength']))
|
||||
print('asyncronous: '+str(cart['asyncronous']))
|
||||
print('owner: '+str(cart['owner']))
|
||||
print('metadataDatetime: '+str(cart['metadataDatetime']))
|
||||
print('songId: '+str(cart['songId']))
|
||||
print('')
|
||||
|
@ -25,6 +25,8 @@
|
||||
import getpass
|
||||
import rivwebpyapi
|
||||
import sys
|
||||
def eprint(*args,**kwargs):
|
||||
print(*args,file=sys.stderr,**kwargs)
|
||||
|
||||
url='';
|
||||
username=''
|
||||
@ -53,12 +55,23 @@ 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)
|
||||
|
||||
#
|
||||
# Get the code list
|
||||
#
|
||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||
codes=webapi.ListCartSchedCodes(cart_number=cart_number)
|
||||
try:
|
||||
codes=webapi.ListCartSchedCodes(cart_number=cart_number)
|
||||
except rivwebpyapi.RivWebPyError as err:
|
||||
eprint('*** ERROR ***')
|
||||
eprint('Response Code: '+str(err.responseCode))
|
||||
eprint('ErrorString: '+str(err.errorString))
|
||||
eprint('*************')
|
||||
eprint('')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Display the code list
|
||||
|
@ -25,6 +25,8 @@
|
||||
import getpass
|
||||
import rivwebpyapi
|
||||
import sys
|
||||
def eprint(*args,**kwargs):
|
||||
print(*args,file=sys.stderr,**kwargs)
|
||||
|
||||
url='';
|
||||
username=''
|
||||
@ -61,15 +63,23 @@ for arg in sys.argv:
|
||||
if(not password):
|
||||
password=getpass.getpass()
|
||||
if((not url)or(not username)):
|
||||
print(usage)
|
||||
eprint(usage)
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Get the cart list
|
||||
#
|
||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||
carts=webapi.ListCarts(group_name=group_name,filter_string=filter_string,
|
||||
cart_type=cart_type,include_cuts=include_cuts)
|
||||
try:
|
||||
carts=webapi.ListCarts(group_name=group_name,filter_string=filter_string,
|
||||
cart_type=cart_type,include_cuts=include_cuts)
|
||||
except rivwebpyapi.RivWebPyError as err:
|
||||
eprint('*** ERROR ***')
|
||||
eprint('Response Code: '+str(err.responseCode))
|
||||
eprint('ErrorString: '+str(err.errorString))
|
||||
eprint('*************')
|
||||
eprint('')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Display the cart list
|
||||
|
@ -25,6 +25,8 @@
|
||||
import getpass
|
||||
import rivwebpyapi
|
||||
import sys
|
||||
def eprint(*args,**kwargs):
|
||||
print(*args,file=sys.stderr,**kwargs)
|
||||
|
||||
url='';
|
||||
username=''
|
||||
@ -56,59 +58,72 @@ 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 cut list
|
||||
#
|
||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||
cuts=webapi.ListCut(cart_number=cart_number,cut_number=cut_number)
|
||||
try:
|
||||
cut=webapi.ListCut(cart_number=cart_number,cut_number=cut_number)
|
||||
except rivwebpyapi.RivWebPyError as err:
|
||||
eprint('*** ERROR ***')
|
||||
eprint('Response Code: '+str(err.responseCode))
|
||||
eprint('ErrorString: '+str(err.errorString))
|
||||
eprint('*************')
|
||||
eprint('')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Display the cut list
|
||||
# Display the cut
|
||||
#
|
||||
for cut in cuts:
|
||||
print('cutName: '+str(cut['cutName']))
|
||||
print('cartNumber: '+str(cut['cartNumber']))
|
||||
print('cutNumber: '+str(cut['cutNumber']))
|
||||
print('evergreen: '+str(cut['evergreen']))
|
||||
print('description: '+str(cut['description']))
|
||||
print('outcue: '+str(cut['outcue']))
|
||||
print('isrc: '+str(cut['isrc']))
|
||||
print('isci: '+str(cut['isci']))
|
||||
print('recordingMbId: '+str(cut['recordingMbId']))
|
||||
print('releaseMbId: '+str(cut['releaseMbId']))
|
||||
print('length: '+str(cut['length']))
|
||||
print('originDatetime: '+str(cut['originDatetime']))
|
||||
print('startDatetime: '+str(cut['startDatetime']))
|
||||
print('endDatetime: '+str(cut['endDatetime']))
|
||||
print('sun: '+str(cut['sun']))
|
||||
print('mon: '+str(cut['mon']))
|
||||
print('tue: '+str(cut['tue']))
|
||||
print('wed: '+str(cut['wed']))
|
||||
print('thu: '+str(cut['thu']))
|
||||
print('fri: '+str(cut['fri']))
|
||||
print('sat: '+str(cut['sat']))
|
||||
print('startDaypart: '+str(cut['startDaypart']))
|
||||
print('endDaypart: '+str(cut['endDaypart']))
|
||||
print('originName: '+str(cut['originName']))
|
||||
print('originLoginName: '+str(cut['originLoginName']))
|
||||
print('sourceHostname: '+str(cut['sourceHostname']))
|
||||
print('weight: '+str(cut['weight']))
|
||||
print('lastPlayDatetime: '+str(cut['lastPlayDatetime']))
|
||||
print('playCounter: '+str(cut['playCounter']))
|
||||
print('codingFormat: '+str(cut['codingFormat']))
|
||||
print('sampleRate: '+str(cut['sampleRate']))
|
||||
print('bitRate: '+str(cut['bitRate']))
|
||||
print('channels: '+str(cut['channels']))
|
||||
print('playGain: '+str(cut['playGain']))
|
||||
print('startPoint: '+str(cut['startPoint']))
|
||||
print('endPoint: '+str(cut['endPoint']))
|
||||
print('fadeupPoint: '+str(cut['fadeupPoint']))
|
||||
print('fadedownPoint: '+str(cut['fadedownPoint']))
|
||||
print('segueStartPoint: '+str(cut['segueStartPoint']))
|
||||
print('segueEndPoint: '+str(cut['segueEndPoint']))
|
||||
print('segueGain: '+str(cut['segueGain']))
|
||||
print('hookStartPoint: '+str(cut['hookStartPoint']))
|
||||
print('hookEndPoint: '+str(cut['hookEndPoint']))
|
||||
print('talkStartPoint: '+str(cut['talkStartPoint']))
|
||||
print('talkEndPoint: '+str(cut['talkEndPoint']))
|
||||
print('cutName: '+str(cut['cutName']))
|
||||
print('cartNumber: '+str(cut['cartNumber']))
|
||||
print('cutNumber: '+str(cut['cutNumber']))
|
||||
print('evergreen: '+str(cut['evergreen']))
|
||||
print('description: '+str(cut['description']))
|
||||
print('outcue: '+str(cut['outcue']))
|
||||
print('isrc: '+str(cut['isrc']))
|
||||
print('isci: '+str(cut['isci']))
|
||||
print('recordingMbId: '+str(cut['recordingMbId']))
|
||||
print('releaseMbId: '+str(cut['releaseMbId']))
|
||||
print('length: '+str(cut['length']))
|
||||
print('originDatetime: '+str(cut['originDatetime']))
|
||||
print('startDatetime: '+str(cut['startDatetime']))
|
||||
print('endDatetime: '+str(cut['endDatetime']))
|
||||
print('sun: '+str(cut['sun']))
|
||||
print('mon: '+str(cut['mon']))
|
||||
print('tue: '+str(cut['tue']))
|
||||
print('wed: '+str(cut['wed']))
|
||||
print('thu: '+str(cut['thu']))
|
||||
print('fri: '+str(cut['fri']))
|
||||
print('sat: '+str(cut['sat']))
|
||||
print('startDaypart: '+str(cut['startDaypart']))
|
||||
print('endDaypart: '+str(cut['endDaypart']))
|
||||
print('originName: '+str(cut['originName']))
|
||||
print('originLoginName: '+str(cut['originLoginName']))
|
||||
print('sourceHostname: '+str(cut['sourceHostname']))
|
||||
print('weight: '+str(cut['weight']))
|
||||
print('lastPlayDatetime: '+str(cut['lastPlayDatetime']))
|
||||
print('playCounter: '+str(cut['playCounter']))
|
||||
print('codingFormat: '+str(cut['codingFormat']))
|
||||
print('sampleRate: '+str(cut['sampleRate']))
|
||||
print('bitRate: '+str(cut['bitRate']))
|
||||
print('channels: '+str(cut['channels']))
|
||||
print('playGain: '+str(cut['playGain']))
|
||||
print('startPoint: '+str(cut['startPoint']))
|
||||
print('endPoint: '+str(cut['endPoint']))
|
||||
print('fadeupPoint: '+str(cut['fadeupPoint']))
|
||||
print('fadedownPoint: '+str(cut['fadedownPoint']))
|
||||
print('segueStartPoint: '+str(cut['segueStartPoint']))
|
||||
print('segueEndPoint: '+str(cut['segueEndPoint']))
|
||||
print('segueGain: '+str(cut['segueGain']))
|
||||
print('hookStartPoint: '+str(cut['hookStartPoint']))
|
||||
print('hookEndPoint: '+str(cut['hookEndPoint']))
|
||||
print('talkStartPoint: '+str(cut['talkStartPoint']))
|
||||
print('talkEndPoint: '+str(cut['talkEndPoint']))
|
||||
|
@ -25,6 +25,8 @@
|
||||
import getpass
|
||||
import rivwebpyapi
|
||||
import sys
|
||||
def eprint(*args,**kwargs):
|
||||
print(*args,file=sys.stderr,**kwargs)
|
||||
|
||||
url='';
|
||||
username=''
|
||||
@ -51,14 +53,25 @@ for arg in sys.argv:
|
||||
if(not password):
|
||||
password=getpass.getpass()
|
||||
if((not url)or(not username)):
|
||||
print(usage)
|
||||
eprint(usage)
|
||||
sys.exit(1)
|
||||
if(cart_number==0):
|
||||
eprint('you must supply "--cart-number"')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Get the cut list
|
||||
#
|
||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||
cuts=webapi.ListCuts(cart_number=cart_number)
|
||||
try:
|
||||
cuts=webapi.ListCuts(cart_number=cart_number)
|
||||
except rivwebpyapi.RivWebPyError as err:
|
||||
eprint('*** ERROR ***')
|
||||
eprint('Response Code: '+str(err.responseCode))
|
||||
eprint('ErrorString: '+str(err.errorString))
|
||||
eprint('*************')
|
||||
eprint('')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Display the cut list
|
||||
|
@ -25,6 +25,8 @@
|
||||
import getpass
|
||||
import rivwebpyapi
|
||||
import sys
|
||||
def eprint(*args,**kwargs):
|
||||
print(*args,file=sys.stderr,**kwargs)
|
||||
|
||||
#
|
||||
# Get login parameters
|
||||
@ -45,34 +47,41 @@ for arg in sys.argv:
|
||||
password=f0[1]
|
||||
if(f0[0]=='--group-name'):
|
||||
group_name=f0[1]
|
||||
if(not group_name):
|
||||
print(usage)
|
||||
sys.exit(1)
|
||||
if(not password):
|
||||
password=getpass.getpass()
|
||||
if((not url)or(not username)):
|
||||
print(usage)
|
||||
eprint(usage)
|
||||
sys.exit(1)
|
||||
if(not group_name):
|
||||
eprint('you must supply "--group-name"')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Get the group list
|
||||
#
|
||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||
groups=webapi.ListGroup(group_name=group_name)
|
||||
try:
|
||||
grp=webapi.ListGroup(group_name=group_name)
|
||||
except rivwebpyapi.RivWebPyError as err:
|
||||
eprint('*** ERROR ***')
|
||||
eprint('Response Code: '+str(err.responseCode))
|
||||
eprint('ErrorString: '+str(err.errorString))
|
||||
eprint('*************')
|
||||
eprint('')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Display the group list
|
||||
#
|
||||
print('')
|
||||
for grp in groups:
|
||||
print('name: '+grp['name'])
|
||||
print('description: '+grp['description'])
|
||||
print('defaultCartType: '+grp['defaultCartType'])
|
||||
print('defaultLowCart: '+str(grp['defaultLowCart']))
|
||||
print('defaultHighCart: '+str(grp['defaultHighCart']))
|
||||
print('cutShelfLife: '+str(grp['cutShelfLife']))
|
||||
print('defaultTitle: '+grp['defaultTitle'])
|
||||
print('enforceCartRange: '+str(grp['enforceCartRange']))
|
||||
print('reportTfc: '+str(grp['reportTfc']))
|
||||
print('reportMus: '+str(grp['reportMus']))
|
||||
print('')
|
||||
print('name: '+grp['name'])
|
||||
print('description: '+grp['description'])
|
||||
print('defaultCartType: '+grp['defaultCartType'])
|
||||
print('defaultLowCart: '+str(grp['defaultLowCart']))
|
||||
print('defaultHighCart: '+str(grp['defaultHighCart']))
|
||||
print('cutShelfLife: '+str(grp['cutShelfLife']))
|
||||
print('defaultTitle: '+grp['defaultTitle'])
|
||||
print('enforceCartRange: '+str(grp['enforceCartRange']))
|
||||
print('reportTfc: '+str(grp['reportTfc']))
|
||||
print('reportMus: '+str(grp['reportMus']))
|
||||
print('')
|
||||
|
@ -25,6 +25,8 @@
|
||||
import getpass
|
||||
import rivwebpyapi
|
||||
import sys
|
||||
def eprint(*args,**kwargs):
|
||||
print(*args,file=sys.stderr,**kwargs)
|
||||
|
||||
#
|
||||
# Get login parameters
|
||||
@ -46,14 +48,22 @@ for arg in sys.argv:
|
||||
if(not password):
|
||||
password=getpass.getpass()
|
||||
if((not url)or(not username)):
|
||||
print(usage)
|
||||
eprint(usage)
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Get the group list
|
||||
#
|
||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||
groups=webapi.ListGroups()
|
||||
try:
|
||||
groups=webapi.ListGroups()
|
||||
except rivwebpyapi.RivWebPyError as err:
|
||||
eprint('*** ERROR ***')
|
||||
eprint('Response Code: '+str(err.responseCode))
|
||||
eprint('ErrorString: '+str(err.errorString))
|
||||
eprint('*************')
|
||||
eprint('')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Display the group list
|
||||
|
@ -25,6 +25,8 @@
|
||||
import getpass
|
||||
import rivwebpyapi
|
||||
import sys
|
||||
def eprint(*args,**kwargs):
|
||||
print(*args,file=sys.stderr,**kwargs)
|
||||
|
||||
url='';
|
||||
username=''
|
||||
@ -52,15 +54,26 @@ for arg in sys.argv:
|
||||
log_name=f0[1]
|
||||
if(not password):
|
||||
password=getpass.getpass()
|
||||
if((not url)or(not username)or(not log_name)):
|
||||
print(usage)
|
||||
if((not url)or(not username)):
|
||||
eprint(usage)
|
||||
sys.exit(1)
|
||||
if(not log_name):
|
||||
eprint('you must supply "--log-name"')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Get the log list
|
||||
#
|
||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||
loglines=webapi.ListLog(log_name=log_name)
|
||||
try:
|
||||
loglines=webapi.ListLog(log_name=log_name)
|
||||
except rivwebpyapi.RivWebPyError as err:
|
||||
eprint('*** ERROR ***')
|
||||
eprint('Response Code: '+str(err.responseCode))
|
||||
eprint('ErrorString: '+str(err.errorString))
|
||||
eprint('*************')
|
||||
eprint('')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Display the log list
|
||||
|
@ -25,6 +25,8 @@
|
||||
import getpass
|
||||
import rivwebpyapi
|
||||
import sys
|
||||
def eprint(*args,**kwargs):
|
||||
print(*args,file=sys.stderr,**kwargs)
|
||||
|
||||
url='';
|
||||
username=''
|
||||
@ -69,9 +71,17 @@ if((not url)or(not username)):
|
||||
# Get the log list
|
||||
#
|
||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||
logs=webapi.ListLogs(service_name=service_name,log_name=log_name,
|
||||
trackable=trackable,filter_string=filter_string,
|
||||
recent=recent)
|
||||
try:
|
||||
logs=webapi.ListLogs(service_name=service_name,log_name=log_name,
|
||||
trackable=trackable,filter_string=filter_string,
|
||||
recent=recent)
|
||||
except rivwebpyapi.RivWebPyError as err:
|
||||
eprint('*** ERROR ***')
|
||||
eprint('Response Code: '+str(err.responseCode))
|
||||
eprint('ErrorString: '+str(err.errorString))
|
||||
eprint('*************')
|
||||
eprint('')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Display the log list
|
||||
|
@ -25,6 +25,8 @@
|
||||
import getpass
|
||||
import rivwebpyapi
|
||||
import sys
|
||||
def eprint(*args,**kwargs):
|
||||
print(*args,file=sys.stderr,**kwargs)
|
||||
|
||||
url='';
|
||||
username=''
|
||||
@ -56,7 +58,15 @@ if((not url)or(not username)):
|
||||
# Get the code list
|
||||
#
|
||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||
codes=webapi.ListSchedulerCodes()
|
||||
try:
|
||||
codes=webapi.ListSchedulerCodes()
|
||||
except rivwebpyapi.RivWebPyError as err:
|
||||
eprint('*** ERROR ***')
|
||||
eprint('Response Code: '+str(err.responseCode))
|
||||
eprint('ErrorString: '+str(err.errorString))
|
||||
eprint('*************')
|
||||
eprint('')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Display the code list
|
||||
|
@ -25,6 +25,8 @@
|
||||
import getpass
|
||||
import rivwebpyapi
|
||||
import sys
|
||||
def eprint(*args,**kwargs):
|
||||
print(*args,file=sys.stderr,**kwargs)
|
||||
|
||||
#
|
||||
# Get login parameters
|
||||
@ -56,7 +58,15 @@ if((not url)or(not username)):
|
||||
# Get the services list
|
||||
#
|
||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||
services=webapi.ListServices(trackable=trackable)
|
||||
try:
|
||||
services=webapi.ListServices(trackable=trackable)
|
||||
except rivwebpyapi.RivWebPyError as err:
|
||||
eprint('*** ERROR ***')
|
||||
eprint('Response Code: '+str(err.responseCode))
|
||||
eprint('ErrorString: '+str(err.errorString))
|
||||
eprint('*************')
|
||||
eprint('')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Display the services list
|
||||
|
@ -25,6 +25,8 @@
|
||||
import getpass
|
||||
import rivwebpyapi
|
||||
import sys
|
||||
def eprint(*args,**kwargs):
|
||||
print(*args,file=sys.stderr,**kwargs)
|
||||
|
||||
url='';
|
||||
username=''
|
||||
@ -56,20 +58,27 @@ if((not url)or(not username)):
|
||||
# Get the code list
|
||||
#
|
||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||
settings=webapi.ListSystemSettings()
|
||||
try:
|
||||
setting=webapi.ListSystemSettings()
|
||||
except rivwebpyapi.RivWebPyError as err:
|
||||
eprint('*** ERROR ***')
|
||||
eprint('Response Code: '+str(err.responseCode))
|
||||
eprint('ErrorString: '+str(err.errorString))
|
||||
eprint('*************')
|
||||
eprint('')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Display the settings list
|
||||
#
|
||||
for setting in settings:
|
||||
print('realmName: '+str(setting['realmName']))
|
||||
print('sampleRate: '+str(setting['sampleRate']))
|
||||
print('duplicateTitles: '+str(setting['duplicateTitles']))
|
||||
print('fixDuplicateTitles: '+str(setting['fixDuplicateTitles']))
|
||||
print('maxPostLength: '+str(setting['maxPostLength']))
|
||||
print('isciXreferencePath: '+str(setting['isciXreferencePath']))
|
||||
print('tempCartGroup: '+str(setting['tempCartGroup']))
|
||||
print('longDateFormat: '+str(setting['longDateFormat']))
|
||||
print('shortDateFormat: '+str(setting['shortDateFormat']))
|
||||
print('showTwelveHourTime: '+str(setting['showTwelveHourTime']))
|
||||
print('')
|
||||
print('realmName: '+str(setting['realmName']))
|
||||
print('sampleRate: '+str(setting['sampleRate']))
|
||||
print('duplicateTitles: '+str(setting['duplicateTitles']))
|
||||
print('fixDuplicateTitles: '+str(setting['fixDuplicateTitles']))
|
||||
print('maxPostLength: '+str(setting['maxPostLength']))
|
||||
print('isciXreferencePath: '+str(setting['isciXreferencePath']))
|
||||
print('tempCartGroup: '+str(setting['tempCartGroup']))
|
||||
print('longDateFormat: '+str(setting['longDateFormat']))
|
||||
print('shortDateFormat: '+str(setting['shortDateFormat']))
|
||||
print('showTwelveHourTime: '+str(setting['showTwelveHourTime']))
|
||||
print('')
|
||||
|
@ -25,6 +25,8 @@
|
||||
import getpass
|
||||
import rivwebpyapi
|
||||
import sys
|
||||
def eprint(*args,**kwargs):
|
||||
print(*args,file=sys.stderr,**kwargs)
|
||||
|
||||
url='';
|
||||
username=''
|
||||
@ -52,9 +54,20 @@ 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)
|
||||
|
||||
#
|
||||
# Execute
|
||||
#
|
||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||
webapi.RemoveCart(cart_number=cart_number)
|
||||
try:
|
||||
webapi.RemoveCart(cart_number=cart_number)
|
||||
except rivwebpyapi.RivWebPyError as err:
|
||||
eprint('*** ERROR ***')
|
||||
eprint('Response Code: '+str(err.responseCode))
|
||||
eprint('ErrorString: '+str(err.errorString))
|
||||
eprint('*************')
|
||||
eprint('')
|
||||
sys.exit(1)
|
||||
|
@ -25,6 +25,8 @@
|
||||
import getpass
|
||||
import rivwebpyapi
|
||||
import sys
|
||||
def eprint(*args,**kwargs):
|
||||
print(*args,file=sys.stderr,**kwargs)
|
||||
|
||||
url='';
|
||||
username=''
|
||||
@ -55,9 +57,23 @@ 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)
|
||||
|
||||
#
|
||||
# Execute
|
||||
#
|
||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||
webapi.RemoveCut(cart_number=cart_number,cut_number=cut_number)
|
||||
try:
|
||||
webapi.RemoveCut(cart_number=cart_number,cut_number=cut_number)
|
||||
except rivwebpyapi.RivWebPyError as err:
|
||||
eprint('*** ERROR ***')
|
||||
eprint('Response Code: '+str(err.responseCode))
|
||||
eprint('ErrorString: '+str(err.errorString))
|
||||
eprint('*************')
|
||||
eprint('')
|
||||
sys.exit(1)
|
||||
|
@ -25,6 +25,8 @@
|
||||
import getpass
|
||||
import rivwebpyapi
|
||||
import sys
|
||||
def eprint(*args,**kwargs):
|
||||
print(*args,file=sys.stderr,**kwargs)
|
||||
|
||||
url='';
|
||||
username=''
|
||||
@ -55,9 +57,23 @@ 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(not sched_code):
|
||||
eprint('you must supply "--sched-code"')
|
||||
sys.exit(1)
|
||||
|
||||
#
|
||||
# Execute
|
||||
#
|
||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||
webapi.UnassignSchedCode(cart_number=cart_number,sched_code=sched_code)
|
||||
try:
|
||||
webapi.UnassignSchedCode(cart_number=cart_number,sched_code=sched_code)
|
||||
except rivwebpyapi.RivWebPyError as err:
|
||||
eprint('*** ERROR ***')
|
||||
eprint('Response Code: '+str(err.responseCode))
|
||||
eprint('ErrorString: '+str(err.errorString))
|
||||
eprint('*************')
|
||||
eprint('')
|
||||
sys.exit(1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user