sprocket-systems.coda.sdk 1.3.1__tar.gz → 1.3.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sprocket-systems.coda.sdk
3
- Version: 1.3.1
3
+ Version: 1.3.3
4
4
  Summary: The Coda SDK provides a Python interface to define Coda workflows, create jobs and run them.
5
5
  Keywords: python,coda,sdk
6
6
  Author-Email: Sprocket Systems <support@sprocket.systems>
@@ -29,7 +29,7 @@ classifiers = [
29
29
  dependencies = [
30
30
  "requests",
31
31
  ]
32
- version = "1.3.1"
32
+ version = "1.3.3"
33
33
 
34
34
  [project.urls]
35
35
  Documentation = "https://coda.sprocket.systems/docs/sdks/python/"
@@ -1,6 +1,6 @@
1
1
  # The versions below will be replaced automatically in CI.
2
2
  # You do not need to modify any of the versions below.
3
- __version__ = "1.3.1"
3
+ __version__ = "1.3.3"
4
4
  CODA_APP_SUITE_VERSION = "+coda-1.72.0"
5
5
  FINAL_VERSION = __version__ + CODA_APP_SUITE_VERSION
6
6
 
@@ -203,14 +203,18 @@ class CodaEssence(object):
203
203
  opts = F['opts']
204
204
  f = F['url']
205
205
 
206
- label =""
207
- chlabels = ['Lsr','Rsr','Lts','Rts','Lss','Rss','Lfe','Ls','Rs','L','C','R']
208
- for ch in chlabels:
209
- if '.'+ch.upper()+'.' in f.upper():
210
- label = ch[0:1].upper()+ch[1:].lower()
211
- if ch=='Lfe':
212
- label = 'LFE'
213
- break
206
+ if 'channel_label' in F:
207
+ label = F['channel_label']
208
+ else:
209
+ label =""
210
+ chlabels = ['Lsr','Rsr','Lts','Rts','Lss','Rss','Lfe','Ls','Rs','L','C','R']
211
+ for ch in chlabels:
212
+ if '.'+ch.upper()+'.' in f.upper():
213
+ label = ch[0:1].upper()+ch[1:].lower()
214
+ if ch=='Lfe':
215
+ label = 'LFE'
216
+ break
217
+
214
218
  res ={
215
219
  'bit_depth' : quant,
216
220
  'sample_rate' : srate,
@@ -664,7 +668,7 @@ class CodaWorkflow(object):
664
668
 
665
669
  def addImaxEnhancedEncodePackage(self,name,process_blocks,encode_profile,essences=('same_as_input','same_as_input'),naming_convention=None,naming_options=None,package_wide_uuid=False):
666
670
 
667
- assert(essences[1] in ['5.1','5.1.4','7.1.4','7.1.5','5.1.1','imax5','imax6','imax12'])
671
+ assert(essences[1] in ['5.1','5.1.4','7.1.5','5.1.1','imax5','imax6','imax12'])
668
672
  if type(encode_profile) is str:
669
673
  presets = CodaPreset.getPresets('dts')
670
674
  pf = [ p for p in presets if p['name']==encode_profile and essences[1] in p['formats'] and 't1cc' in p['definition'] and p['definition']['t1cc']]
@@ -720,6 +724,12 @@ class CodaWorkflow(object):
720
724
  #assert(block['output_settings']['venue']=='theatrical')
721
725
  fps = essences[0]
722
726
  fmt = essences[1]
727
+ if fmt=='imax5':
728
+ fmt='5.1'
729
+ elif fmt=='imax6':
730
+ fmt='5.1.1'
731
+ elif fmt=='imax12':
732
+ fmt='5.1.4'
723
733
  if t1cc and fmt!='same_as_input' and 'imax' not in fmt:
724
734
  fmt += ';mode=imax_enhanced'
725
735
  typ = "printmaster"
@@ -880,7 +890,7 @@ class CodaWorkflow(object):
880
890
  for fr in fps:
881
891
  for F in fmt:
882
892
  for t in typ:
883
- block['output_essences'][t+'_'+fr+'_'+F]= {
893
+ block['output_essences'][t+'_'+fr+'_'+F.replace(';','_').replace('=','_')]= {
884
894
  'audio_format': F,
885
895
  'frame_rate': fr,
886
896
  'type':t
@@ -1212,7 +1222,8 @@ class CodaJob(object):
1212
1222
  if 'id' in J:
1213
1223
  print('got src agent from data-io client',J['id'],file=sys.stderr)
1214
1224
  self.src_agent= J['id']
1215
- except:
1225
+ except Exception as E:
1226
+ print('error getting agent from data-io client',str(E),file=sys.stderr)
1216
1227
  pass
1217
1228
 
1218
1229
  if (os.getenv('CODA_GROUP_ID')):
@@ -1310,7 +1321,11 @@ class CodaJob(object):
1310
1321
  if force_fps is not None:
1311
1322
  fpsflag = [ '--frame-rate'] + [ force_fps ]
1312
1323
 
1313
- ret = subprocess.run([codaexe] +['inspect']+ fpsflag + ['-i'] + absfiles,shell=False,check=True,stdout = subprocess.PIPE)
1324
+ cmd = [codaexe] +['inspect']+ fpsflag + ['-i'] + absfiles
1325
+
1326
+ #print(' '.join(cmd),file=sys.stderr)
1327
+
1328
+ ret = subprocess.run(cmd,shell=False,check=True,stdout = subprocess.PIPE)
1314
1329
  j = json.loads(ret.stdout)
1315
1330
  for t in j['sources']:
1316
1331
  for g in j['sources'][t]:
@@ -1423,6 +1438,12 @@ class CodaJob(object):
1423
1438
  self.groupId = int(gid)
1424
1439
  return
1425
1440
 
1441
+ @staticmethod
1442
+ def get_jobs_by_date(start_date,end_date):
1443
+ ret = make_request(requests.get,38383,f'/interface/v1/jobs?sort=asc&start_date={start_date}&end_date={end_date}')
1444
+ #print(ret.json(),file=sys.stderr)
1445
+ return ret.json()
1446
+
1426
1447
  @staticmethod
1427
1448
  def run_raw_payload(J):
1428
1449
  CodaJob.validate_raw_payload(J)