mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-08-16 08:34:12 +02:00
2021-12-08 Fred Gleason <fredg@paravelsystems.com>
* Modified the 'rivwebpyapi.Import()' method to return a dictionary containing the cart and cut numbers of the import destination. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
9d4e6bbf2c
commit
4b3ae602b9
@ -22708,3 +22708,6 @@
|
|||||||
dictionary.
|
dictionary.
|
||||||
* Modified the 'rivwebpyapi.ListSystemSettings()' method to return a
|
* Modified the 'rivwebpyapi.ListSystemSettings()' method to return a
|
||||||
single dictionary.
|
single dictionary.
|
||||||
|
2021-12-08 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Modified the 'rivwebpyapi.Import()' method to return a dictionary
|
||||||
|
containing the cart and cut numbers of the import destination.
|
||||||
|
@ -844,6 +844,21 @@ 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)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Process Response
|
||||||
|
#
|
||||||
|
fields={
|
||||||
|
'ResponseCode': 'integer',
|
||||||
|
'ErrorString': 'string',
|
||||||
|
'CartNumber': 'integer',
|
||||||
|
'CutNumber': 'integer'
|
||||||
|
}
|
||||||
|
handler=RivWebPyApi_ListHandler(base_tag='RDWebResult',fields=fields)
|
||||||
|
xml.sax.parseString(r.text,handler)
|
||||||
|
output=handler.output();
|
||||||
|
if(len(output)==1):
|
||||||
|
return output[0]
|
||||||
|
|
||||||
def ListCart(self,cart_number,include_cuts=False):
|
def ListCart(self,cart_number,include_cuts=False):
|
||||||
"""
|
"""
|
||||||
Returns the metadata associated with a Rivendell cart
|
Returns the metadata associated with a Rivendell cart
|
||||||
|
@ -79,10 +79,10 @@ if(not password):
|
|||||||
if((not url)or(not username)):
|
if((not url)or(not username)):
|
||||||
print(usage)
|
print(usage)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
if(cart_number==0):
|
if((not group_name)and(cart_number==0)):
|
||||||
eprint('you must supply "--cart-number"')
|
eprint('you must supply "--cart-number"')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
if(cut_number==0):
|
if((not group_name)and(cut_number==0)):
|
||||||
eprint('you must supply "--cut-number"')
|
eprint('you must supply "--cut-number"')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
if(not filename):
|
if(not filename):
|
||||||
@ -94,11 +94,12 @@ if(not filename):
|
|||||||
#
|
#
|
||||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||||
try:
|
try:
|
||||||
webapi.Import(filename=filename,cart_number=cart_number,
|
result=webapi.Import(filename=filename,cart_number=cart_number,
|
||||||
cut_number=cut_number,
|
cut_number=cut_number,channels=channels,
|
||||||
channels=channels,normalization_level=normalization_level,
|
normalization_level=normalization_level,
|
||||||
autotrim_level=autotrim_level,use_metadata=use_metadata,
|
autotrim_level=autotrim_level,
|
||||||
group_name=group_name,title=title)
|
use_metadata=use_metadata,group_name=group_name,
|
||||||
|
title=title)
|
||||||
except rivwebpyapi.RivWebPyError as err:
|
except rivwebpyapi.RivWebPyError as err:
|
||||||
eprint('*** ERROR ***')
|
eprint('*** ERROR ***')
|
||||||
eprint('Response Code: '+str(err.responseCode))
|
eprint('Response Code: '+str(err.responseCode))
|
||||||
@ -106,3 +107,14 @@ except rivwebpyapi.RivWebPyError as err:
|
|||||||
eprint('*************')
|
eprint('*************')
|
||||||
eprint('')
|
eprint('')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Display the destination info
|
||||||
|
#
|
||||||
|
print('')
|
||||||
|
if(group_name):
|
||||||
|
print('ADDED:')
|
||||||
|
print('cartNumber: '+str(result['CartNumber']))
|
||||||
|
print('cutNumber: '+str(result['CutNumber']))
|
||||||
|
print('')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user