mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-20 15:02:27 +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.
|
||||
* Modified the 'rivwebpyapi.ListSystemSettings()' method to return a
|
||||
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):
|
||||
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):
|
||||
"""
|
||||
Returns the metadata associated with a Rivendell cart
|
||||
|
@ -79,10 +79,10 @@ if(not password):
|
||||
if((not url)or(not username)):
|
||||
print(usage)
|
||||
sys.exit(1)
|
||||
if(cart_number==0):
|
||||
if((not group_name)and(cart_number==0)):
|
||||
eprint('you must supply "--cart-number"')
|
||||
sys.exit(1)
|
||||
if(cut_number==0):
|
||||
if((not group_name)and(cut_number==0)):
|
||||
eprint('you must supply "--cut-number"')
|
||||
sys.exit(1)
|
||||
if(not filename):
|
||||
@ -94,11 +94,12 @@ if(not filename):
|
||||
#
|
||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||
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)
|
||||
result=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))
|
||||
@ -106,3 +107,14 @@ except rivwebpyapi.RivWebPyError as err:
|
||||
eprint('*************')
|
||||
eprint('')
|
||||
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