mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-18 08:31:16 +02:00
2021-12-11 Fred Gleason <fredg@paravelsystems.com>
* Added a 'Cut' class to the 'rivwebapi' API. * Modified the 'AddCut()', 'ListCut()' and 'ListCuts()' methods to use the 'Cut' class in the 'rivwebapi' API. * Added an 'EditCut()' method to the 'rivwebpyapi' API. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -29,6 +29,7 @@ EXTRA_DIST = add_cart.py\
|
||||
delete_audio.py\
|
||||
delete_log.py\
|
||||
edit_cart.py\
|
||||
edit_cut.py\
|
||||
export.py\
|
||||
export_peaks.py\
|
||||
get_podcast.py\
|
||||
|
@@ -77,48 +77,6 @@ except rivwebpyapi.RivWebPyError as err:
|
||||
# Display the cut
|
||||
#
|
||||
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']))
|
||||
for key in cut.values():
|
||||
print(key+': '+str(cut.values()[key]))
|
||||
print('')
|
||||
|
@@ -37,7 +37,7 @@ values={}
|
||||
#
|
||||
# Get login parameters
|
||||
#
|
||||
usage='list_cart --url=<rd-url> --username=<rd-username> --cart-number=<num> [--set-value=<field>=<str> ...] [--password=<passwd>]'
|
||||
usage='edit_cart --url=<rd-url> --username=<rd-username> --cart-number=<num> [--set-value=<field>=<str> ...] [--password=<passwd>]'
|
||||
for arg in sys.argv:
|
||||
f0=arg.split('=')
|
||||
key=f0[0]
|
||||
|
100
apis/rivwebpyapi/tests/edit_cut.py
Executable file
100
apis/rivwebpyapi/tests/edit_cut.py
Executable file
@@ -0,0 +1,100 @@
|
||||
#!%PYTHON_BANGPATH%
|
||||
|
||||
# edit_cut.py
|
||||
#
|
||||
# RivWebPyApi test script for Rivendell
|
||||
#
|
||||
# Test the EditCut Web API call
|
||||
#
|
||||
# (C) Copyright 2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
|
||||
import getpass
|
||||
import rivwebpyapi
|
||||
import sys
|
||||
def eprint(*args,**kwargs):
|
||||
print(*args,file=sys.stderr,**kwargs)
|
||||
|
||||
url='';
|
||||
username=''
|
||||
password=''
|
||||
cart_number=0
|
||||
cut_number=0
|
||||
values={}
|
||||
|
||||
#
|
||||
# Get login parameters
|
||||
#
|
||||
usage='edit_cut --url=<rd-url> --username=<rd-username> --cart-number=<num> --cut-number=<num> [--set-value=<field>=<str> ...] [--password=<passwd>]'
|
||||
for arg in sys.argv:
|
||||
f0=arg.split('=')
|
||||
key=f0[0]
|
||||
del f0[0]
|
||||
value='='.join(f0)
|
||||
if(value):
|
||||
if(key=='--url'):
|
||||
url=value
|
||||
if(key=='--username'):
|
||||
username=value
|
||||
if(key=='--password'):
|
||||
password=value
|
||||
if(key=='--cart-number'):
|
||||
cart_number=int(value)
|
||||
if(key=='--cut-number'):
|
||||
cut_number=int(value)
|
||||
if(key=='--set-value'):
|
||||
f1=value.split('=')
|
||||
key1=f1[0]
|
||||
del f1[0]
|
||||
values[key1]='='.join(f1)
|
||||
|
||||
if(not password):
|
||||
password=getpass.getpass()
|
||||
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)
|
||||
cut=rivwebpyapi.Cut()
|
||||
cut.setValues(values)
|
||||
|
||||
try:
|
||||
cut=webapi.EditCut(cart_number=cart_number,cut_number=cut_number,
|
||||
values=cut.values())
|
||||
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 modified cut
|
||||
#
|
||||
print('MODIFIED')
|
||||
for key in cut.values():
|
||||
print(key+': '+str(cut.values()[key]))
|
||||
print('')
|
@@ -82,48 +82,7 @@ except rivwebpyapi.RivWebPyError as err:
|
||||
#
|
||||
# Display the cut
|
||||
#
|
||||
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:')
|
||||
for key in cut.values():
|
||||
print(key+': '+str(cut.values()[key]))
|
||||
print('')
|
||||
|
@@ -77,49 +77,6 @@ except rivwebpyapi.RivWebPyError as err:
|
||||
# Display the cut list
|
||||
#
|
||||
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']))
|
||||
for key in cut.values():
|
||||
print(key+': '+str(cut.values()[key]))
|
||||
print('')
|
||||
|
Reference in New Issue
Block a user