-
BOc       s     d  k  Z   d  k Z  d  k Z  d  k Z  d  k Z  d  k Z  d  k i Z 	 d  k	 Z 
 d  k
 i Z  d  k Z  d  k Z  d  k i Z  d  k Z  d  k Z  d  k i Z  d  k i Z  d   Z   e d  Z S e d  Z  d f  d     YZ  d e f d     YZ  d e f d	     YZ  d
 e f d     YZ  d e f d     YZ   d e i! i" f d     YZ# Le d  Z$ ]d   Z% ld   Z& ud   Z' ~d   Z( d   Z) d   Z* d   Z+ d   Z, d   Z- e d  Z. d   Z/ 'd   Z0 +d   Z1 6d   Z2 ;d   Z3 Rd    Z4 Wd!   Z5 \d"   Z6 hd# Z7 id$ Z8 je#   Z9 ke a: lh  Z; me a< d  S(%   Nc    sc      t  i   a  t i i |  i   t i |  i  a  t	 i
 i
 t i d d  a d  S(   Ns   /data/volatile/eventlogs/runlogi  (   s	   twccommons   Datas   _configs   __dict__s   updates   configs   PluginManagers   playlistPluginRoots
   _pluginMgrs   twcs   EventLogs
   twcPersDirs   _runlog(   s   config(    (    s   pm.pys   init s
   c    s    ! z# d t  i } $ t | d  i   % | d j o & t i d |   ( d  Sn * t	 i
 d t g  , | t j o - g  } n . t i d |  d | d | 0 d	 | d
 | 1 d t i   | d 2 d |  } 3 | t |  <6 t i d |  | f  8 t |  }	 ; t | |	  } < | t j o = t i d  > d  Sn' A d t  i } B t | d  i   F | | _ H g  }
 I x' | i DI ] } J |
 i | i  qWM t |
  Wd  O P t   Xd  S(   Ns   %s/playlistloads   wi    s7   request to load presentation %s with 0 duration ignoreds   %s/libs   ids   durations   expires	   scheduless   paramss
   expireTimei   s   runlogEventss8   attempting to build presentation (id=%s, schedule=%s)...s    couldn't generate a presentations   %s/playlistgenerate(    s   _configs   tempDirs   fnames   opens   closes   durations   Logs   errors   ids   _pls   _rmOldLocalModuless   _ROOTs   runlogEventss   Nones	   twccommons   Datas   expires	   scheduless   paramss   times   argDatas   _presentationss   infos   evals   schedLoaderss   _buildBestSchedPresentationss   presentationss   rsFiless   vpPress   appends   _runRenderScriptFiless   _flush(   s   ids   durations   expires	   scheduless   paramss   runlogEventss   vpPress   argDatas   presentationss   schedLoaderss   rsFiless   fname(    (    s   pm.pys   load  s<   	 	c    s  S U t  |  }	 V t  |  =X | |	 _ Y | |	 _ ] g  } ^ x|	 i D^ ]} _ y ` | t	 j o a | i
   } n c t i   } d | | _ e | | _ f | i |  h t | i d  \ } } i | | _ j t d   |  | _ l t | | i d | n d |	 i } o | i |  Wn& q t j
 o r t i d  n XqH Wu y7 v t |  x d t i } y t  | d  i!   Wn& z t j
 o { t i d  n X~ t" | d	  o  t# i$ d
 | i%  }  | t	 j o<  t# i$ d  }  | t	 j o  d d d f } n n  | \ }
 } }  t* | |  n  t+ |	   t, |	   t-    t.   d  S(   Ns   Run.rsc    s   j d |  S(   Ns   %s/incl(   s   e(   s   e(    (    s   pm.pys   <lambda>j s    s   paramss   runlogEventss   error building presentations   %s/playlistruns   ws   error running presentations
   sidChannels   irdChannelSidTable.%ss   irdChannelSidTable.defaults   100i)#  s   OA(/   s   _presentationss   ids   argDatas	   startTimes
   startFrames   rsFiless   presentationss   vpPress   paramss   Nones   clones   pparamss	   twccommons   Datas   updates	   _findFiles   prodTypes   rsfnames
   searchPaths	   runScripts   maps   runInclPaths   _buildRenderScriptFiles   runlogEventss   fnames   appends	   Exceptions   Logs   logCurrentExceptions   _runRenderScriptFiless   _configs   tempDirs   opens   closes   hasattrs   dsms   defaultedConfigGets
   sidChannels   irdChannelSidTables   irdChans   sids   sidSums   _runUpdateSIDs   _buildTestLogs   _buildRunLogs   _refreshMedias   _cull(   s   ids	   startTimes
   startFrames   paramss
   searchPaths   vpPress   pparamss   sidSums   rsfnames   argDatas   irdChans   irdChannelSidTables   rsFiless   fnames   sid(    (    s   pm.pys   runS sP   
	 	
s   ScheduleLoaderc      s     d   Z   d   Z RS(   Nc    s     |  i   Sd  S(   N(   s   selfs   __str__(   s   self(    (    s   pm.pys   __repr__ s   c    s
     d  S(   N(    (   s   selfs   duration(    (    s   pm.pys   getSchedule s   (   s   __repr__s   getSchedule(    (    (    s   pm.pys   ScheduleLoader s   s   CompositeSchedulec      s5     d   Z   d   Z  d   Z  d   Z RS(   Nc    s     | |  _ d  S(   N(   s   loaderss   selfs   _loaders(   s   selfs   loaders(    (    s   pm.pys   __init__ s   c    s-     d |  i i t d   |  i  f Sd  S(   Ns   %s(%s)c    s    t  |   S(   N(   s   strs   e(   s   e(    (    s   pm.pys   <lambda> s    (   s   selfs	   __class__s   __name__s   maps   _loaders(   s   self(    (    s   pm.pys   __str__ s   c    s#     t  t d   |  i   Sd  S(   Nc    s    |  i   S(   N(   s   es   details(   s   e(    (    s   pm.pys   <lambda> s    (   s   strs   maps   selfs   _CompositeSchedule__loaders(   s   self(    (    s   pm.pys   details s   c    sJ     h  }  x- |  i D ] }  | i | i |   q W | Sd  S(   N(   s   schedules   selfs   _loaderss   sls   updates   getSchedules   duration(   s   selfs   durations   sls   schedule(    (    s   pm.pys   getSchedule s
   	 	(   s   __init__s   __str__s   detailss   getSchedule(    (    (    s   pm.pys   CompositeSchedule s   s   SingleSchedulec      s     d   Z   d   Z RS(   Nc    s     | |  _ d  S(   N(   s	   schedNames   selfs   scheduleName(   s   selfs	   schedName(    (    s   pm.pys   __init__ s   c    s!     d |  i i |  i f Sd  S(   Ns   %s(%s)(   s   selfs	   __class__s   __name__s   scheduleName(   s   self(    (    s   pm.pys   __str__ s   (   s   __init__s   __str__(    (    (    s   pm.pys   SingleSchedule s   s   StaticSchedulec      s     d   Z  RS(   Nc    s    t  i |  i  }  | i |  }  h  }  xV| i	   D ]E\ } }  g  }  x| D ]\ } }  t i | | d  }  | i    t |  d j o7  | d }  | i | | |   | i |  n  d }	  g  }
  x- | D ]" }  |
 i |	 | | | f  qW | i |
   | i |   | i t d   | d    | i |  qe W | | | <qC W | Sd  S(   Ni    i   c    s    |  | S(   N(   s   as   b(   s   as   b(    (    s   pm.pys   <lambda> s    (   s
   _pluginMgrs   retrievePlugins   selfs   scheduleNames   mods   getSchedules   durations   tmps   schedules   itemss   prodTypes   tmppls   playlists   prodNames   durss   _pls   loadProducts   prods   loadDatas   lens   durs   getDesiredDurations   setDurations   is   fdurss   es   appends   getDesiredPageDurationss   setPageDurationss   reduce(   s   selfs   durations   tmps   tmppls   prods   es   schedules   prodNames   prodTypes   is   fdurss   durs   playlists   durss   mod(    (    s   pm.pys   getSchedule s2   	 	
 		
 	 (   s   getSchedule(    (    (    s   pm.pys   StaticSchedule s   s   DynamicSchedulec      s     d   Z  RS(   Nc    s     t  i   }  t i d |  i   t i |  i  }  | t
 j o  t i d |  i  n)  t i | | g  }  t  i |   t i i |  i | t   Sd  S(   Ns   Schedule Name: %ss   couldn't find config entry %s(   s   _pls   getDefaultParamss   paramss   Logs   infos   selfs   scheduleNames   dsms   defaultedConfigGets   playlistParamss   Nones   warnings	   twccommons   mergeStructss   setDefaultParamss   twcs   playlists   getSchedules   duration(   s   selfs   durations   playlistParamss   params(    (    s   pm.pys   getSchedule s   (   s   getSchedule(    (    (    s   pm.pys   DynamicSchedule s   s   _ProdLoaderc      sY     d   Z   d   Z  d   Z d   Z d   Z &d   Z Gd   Z RS(   Nc    s5     t  i i i |    d |  _  t |  _ d  S(   Ni(   s   twcs   productss   ProductLoaders   __init__s   selfs
   _purgeTimes   Nones   _params(   s   self(    (    s   pm.pys   __init__ s   c    s     | |  _ d  S(   N(   s   paramss   selfs   _params(   s   selfs   params(    (    s   pm.pys   setDefaultParams s   c    s6     t  i   }  | i i |  i i   | Sd  S(   N(   s   twcs   Datas   ds   __dict__s   updates   selfs   _params(   s   selfs   d(    (    s   pm.pys   getDefaultParams s   c    s-   d t  | f g } |  i |  d  S(   Ns	   %s/%s/lib(   s   _ROOTs   prodTypes   libpaths   selfs   _rmOldLocalModules(   s   selfs   prodTypes   libpath(    (    s   pm.pys   startProdTypes   c    sd  	t  i d | | f  |  i   } t d | | f | |  } t
 i | | g  } t | d |  \ } } t d   |  }	 t d   |  }
 | | _ | | _ |
 | _ |	 | _ | | _ | | _ | | _ d | | f | _ t i } z* |	 t i t _  |  i | |  SWd  "#| t _ Xd  S(   Ns   loading product %s_%s...s   %s_%ss   %s.prodc    s   d |  S(   Ns   %s/lib(   s   e(   s   e(    (    s   pm.pys   <lambda>s    c    s   d |  S(   Ns   %s/incl(   s   e(   s   e(    (    s   pm.pys   <lambda>s    (   s   Logs   infos   prodTypes   prodNames   selfs   getDefaultParamss   paramss
   getAttribss   prodInsts   pparamss	   twccommons   mergeStructss	   _findFiles   prodFiles
   searchPaths   maps   libPaths   inclPaths   products   syss   paths   tmps   loadProductFile(   s   selfs   prodTypes   prodNames   prodInsts   tmps   prodFiles
   searchPaths   pparamss   paramss   libPaths   inclPath(    (    s   pm.pys   loadProducts*   c 	   sl  &'t  i d |  (g  } )xt i i   D)]
\ } } *y +| i	 } Wn -t j
 o .q3 n X0t i i |  } 1| | j o
 2q3 n 4d } 5y= 6t i |  t i } 7|  i | j  o 8d } n Wn :t j
 o ;d } n X=| o( >t  i d |  A| i |  n q3 WCx | DC] } Dt i | =qNWd  S(   Ns&   checking %s for old dynamic pm modulesi    i   s3   purging dynamic pm module %s because it is outdated(   s   Logs   debugs   libpathss   cleans   syss   moduless   itemss   mnames   mods   __file__s   fnames   AttributeErrors   oss   paths   dirnames   purges   stats   ST_MTIMEs   mtimes   selfs
   _purgeTimes	   Exceptions   infos   append(	   s   selfs   libpathss   purges   mnames   mtimes   cleans   fnames   paths   mod(    (    s   pm.pys   _rmOldLocalModules&s0   	 
	

 	c    s/   GHt  i i i |   It i   |  _ d  S(   N(   s   twcs   productss   ProductLoaders   flushs   selfs   times
   _purgeTime(   s   self(    (    s   pm.pys   flushGs   (   s   __init__s   setDefaultParamss   getDefaultParamss   startProdTypes   loadProducts   _rmOldLocalModuless   flush(    (    (    s   pm.pys   _ProdLoader s   !c    s   LMt  t i    } Nd d | d | |  f d | |  | f d | g } Vt i |  } W| o Xt i | | g  } n Z| Sd  S(   Ns   Configs	   Config.%ds   Config.%d.%ss   Config.%d.%s.%ds   Config.%d.Override(   s   ints   dsms   getConfigVersions
   cfgVersions   products   prodInsts   kls   twcs   getAttribLists
   fullParamss   paramss	   twccommons   mergeStructs(   s   products   prodInsts   paramss
   fullParamss
   cfgVersions   kl(    (    s   pm.pys
   getAttribsLs   7
c    s   ]^d t  |  f t  g } _| } axd at |  d j oM b| d d | } ct i i	 |  o d| | f Sn f| d } q+ Wht
 d | | f  d  S(   Ns   %s/%si    s   /%si   s   couldn't locate file %s in %s(   s   _ROOTs   prodTypes   pathss   pathsSearcheds   lens   fnames   fullnames   oss   paths   existss	   Exception(   s   prodTypes   fnames   pathss   pathsSearcheds   fullname(    (    s   pm.pys	   _findFile]s   	 c    sY   lmxE |  Dm]: } nd | | f } ot i  i |  o p| Sn q Wrt Sd  S(   Ns   %s/%s(   s   paths   ps   fnames   fullnames   oss   existss   None(   s   paths   fnames   ps   fullname(    (    s   pm.pys   _findInPathls   
 	c    s>   uvt  |   } wz x| i   SWd  z{| i   Xd  S(   N(   s   files   fnames   fs   reads   close(   s   fnames   f(    (    s   pm.pys	   _readFileus
   c    sL   ~t  } y t i |   } Wn t j
 o
 n X| Sd  S(   N(   s   Nones   vals   dsms   defaultedGets   keys	   Exception(   s   keys   val(    (    s   pm.pys   _dsmget~s   	c    s  g  } xz| D]o} y9t i d |  |  i i   }	 t i	 |	  | i
 |  i  } x | i   D] \ } } g  } xd | D]Y } | i   } x. | D]# } | i d j o
 q n q W| i |  q Wd | }
 t i d |
  t i |
 | d  t i   q Wt |  |  SWn* t j
 o t i d |  n Xq Wt Sd  S(   Ns   building schedule %s...s   *s   %s.playlistSchedules    Setting playlist schedule for %si    s   error building schedule %s:(    s   presentationss   schedLoaderss   schedLoaders   Logs   infos   argDatas   paramss   clones   _pls   setDefaultParamss   getSchedules   durations   schedules   itemss   prodTypes   playlists
   prodLabelss   prods   getLabels   labelss	   labelDatas   labels   appends   keys   dsms   sets   dss   commits   _buildSchedPresentationss	   Exceptions   logCurrentExceptions   None(   s   argDatas   schedLoaderss   playlists   schedules
   prodLabelss   presentationss   prodTypes   labelss	   labelDatas   paramss   keys   prods   schedLoader(    (    s   pm.pys   _buildBestSchedPresentationss6   	
 	 	
 	
 	c    s   g  } t i d | i    xM | i   D]< \ } } t i d |  | i t	 |  | |   q6 W| Sd  S(   Ns,   schedule contains the following playlists %ss$   building playlist for viewport %s...(   s   vpPresentationss   Logs   infos   schedules   keyss   itemss   prodTypes   playlists   appends   _buildViewportPresentations   argData(   s   argDatas   schedules   playlists   vpPresentationss   prodType(    (    s   pm.pys   _buildSchedPresentationss   	  c    sJ  t  i   }
 | |
 _ g  |
 _ t i d |  |
 _ d | |  i	 f |
 i _
 |  i |
 i _ t d   |  |
 _ d } d }	 d } x | D] } t i d | i   | i   f  | i d | d |	 d | d	 |
 i d
 |
 i d |  t |  |
 |  } |	 | i i   7}	 | d 7} |
 i i |  q W|  i i   } t i | _ |
 i | _ t d   |
 i  | _ g  } t  |
 i d  \ } } | |
 _# t d   |  |
 _$ t% | |
 i$ |
 i i
 d | d | |
 _& |  i i' |  |
 Sd  S(   Ns   viewport.%ss   %s_%sc    s"   |  i   |  i   |  i   f S(   N(   s   es   getNames   getDurations   getProdInstance(   s   e(    (    s   pm.pys   <lambda>s    i    s5   building presentation for product %s (duration=%s)...s	   startTimes   startFrameOffsets   prodTypes
   layerPropss   prodSchedules	   prodCounti   c    s   |  i |  i i   f S(   N(   s   es   fnames   prods   getDuration(   s   e(    (    s   pm.pys   <lambda>s    s   Load.rsc    s   d |  S(   Ns   %s/incl(   s   e(   s   e(    (    s   pm.pys   <lambda>s    s   paramss   runlogEvents((   s	   twccommons   Datas   vpPress   prodTypes   prodPresentationss   dsms	   configGets
   layerPropss   argDatas   ids   names   expires   maps   playlists   prodSchedules	   startTimes   startFrameOffsets	   prodCounts   prods   Logs   infos   getNames   getDurations   updateParamss   _buildProductPresentations   press   appends   paramss   clones   _configs   prerolls   runlogEventss	   _findFiles   rsfnames
   searchPaths
   loadScripts   loadInclPaths   _buildRenderScriptFiles   fnames   extend(   s   argDatas   prodTypes   playlists
   searchPaths   rsfnames	   prodCounts   runlogEventss	   startTimes   paramss   startFrameOffsets   vpPress   prods   pres(    (    s   pm.pys   _buildViewportPresentations@   			
 	&	c    s   t  i   } | | _ g  } t | i | | i   i	 d | | _
 |  i i |  t i d | i   | i
 f  | Sd  S(   Ns   runlogEventss#   generated render script for %s (%s)(   s	   twccommons   Datas   press   prods   runlogEventss   _buildPresFiles   vpPress   prodTypes	   getParamss   inclPaths   fnames   argDatas   extends   Logs   infos   getName(   s   argDatas   vpPress   prods   runlogEventss   pres(    (    s   pm.pys   _buildProductPresentations   	#c    s}   t  i t i | i   d  \ } } | i d |  | i	 |  | |  } | i |  | i   | Sd  S(   Ns   rscs   fname(   s   domestics   tmpFiles   _configs   tempDirs   prods   getNames   fnames   fs   updateParamss   genRenderScripts   prodTypes	   inclpathss   nss   rss   writes   close(   s   prodTypes   prods	   inclpathss   nss   fnames   fs   rs(    (    s   pm.pys   _buildPresFiles   'c    s   t  |   } t i i | | |  } 
| t
 j o, d t i | f } t | d  } n" t i t i d d  \ } } | i |  | i   | Sd  S(   Ns	   %s/%s.rscs   ws    s   rsc(   s	   _readFiles   rsfnames   rss   twcs   psps   evalRenderScripts   kws   inclPaths   rscs   dsts   Nones   _configs   tempDirs   fnames   files   fs   domestics   tmpFiles   writes   close(   s   rsfnames   inclPaths   dsts   kws   fs   rss   rscs   fname(    (    s   pm.pys   _buildRenderScriptFiles   !c    s   d } t i t i d d  \ } } | i |  xA |  D]6 } | i d  | i |  | i d  qG W!| i
   #t i d |  $t |  d  S(   Ns/   from twc.embedded.renderd import RenderControl
s    s   ldrs    RenderControl.loadPresentation("s   ")
s   running render script files %s(   s   hdrs   domestics   tmpFiles   _configs   tempDirs
   loaderFiles   fs   writes
   rsFileLists   rss   closes   Logs   infos   _runRenderScriptFile(   s
   rsFileLists   fs   rss
   loaderFiles   hdr(    (    s   pm.pys   _runRenderScriptFiless   	!
 	c    s   '(t  i i |   d  S(   N(   s   twcs   MiscCorbaInterfaces   runRenderScripts   rsfname(   s   rsfname(    (    s   pm.pys   _runRenderScriptFile's   c    s   +,d } .t i t i d d  \ } } /| i |  0| i d |  | f  1| i
   2t i d |  3t |  d  S(   Ns/   from twc.embedded.renderd import RenderControl
s    s   ldrs(   RenderControl.setWatermarkSID(%d, "%s")
s   running render script files %s(   s   hdrs   domestics   tmpFiles   _configs   tempDirs
   loaderFiles   fs   writes   sids   sidSums   closes   Logs   infos   _runRenderScriptFile(   s   sids   sidSums   hdrs   fs
   loaderFile(    (    s   pm.pys   _runUpdateSID+s   	!c      s!   67t  i   8t i   d  S(   N(   s   _pls   flushs   dss
   clearCache(    (    (    s   pm.pys   _flush6s   c    sG  ;<|  i   } =| ` ?x |  i D?] } @| i   } At | | i |  B| ` Dx | i DD] } E| i   } F| ` Gt | | i i   |  It | d | i i    Jt | d | i i    Kt | d | i i    ql Wq( WMd t | i f } Nt i | d  } O| i d |  d  S(   Ns   paramss   datas   testDatas	   %s/%s.xmli   s   presentation(   s   argDatas   clones   adts   presentationss   vpPress   vdts   setattrs   prodTypes   prodPresentationss   press   pdts   prods   getShortNames	   getParamss   getDatas   getTestDatas	   _LOG_ROOTs   ids   fnames   DataEventLogs   dls	   writeData(   s   argDatas   adts   vdts   pdts   dls   fnames   vpPress   pres(    (    s   pm.pys   _buildTestLog;s$   	 		 		$c    s:   RSx- |  i DS] \ } } Tt i | |  q Wd  S(   N(   s   argDatas   runlogEventss   ks   vs   _runlogs	   writeData(   s   argDatas   ks   v(    (    s   pm.pys   _buildRunLogRs    c      s   WYt  i i   d  S(   N(   s   twcWxs   mappings
   refreshAll(    (    (    s   pm.pys   _refreshMediaWs   c     s   \]g  } ^t i   } _xD t i   D_]3 \ }  } `| | i j o a| i |   n q+ Wcx/ | Dc]$ }  dt	 i
 d |   et |  =qo Wd  S(   Ns    removing expired presentation %s(   s   culleds   times   nows   _presentationss   itemss   keys   vals
   expireTimes   appends   Logs   info(   s   keys   vals   culleds   now(    (    s   pm.pys   _cull\s   	 
 	s   /twc/products/pms   /twc/data/volatile/testlogs(=   s   domestics   oss   stats   syss   times   twcs   twc.DataStoreInterfaces   DataStoreInterfaces   dss   twc.MiscCorbaInterfaces   twc.dsmarshals	   dsmarshals   dsms   twc.playlists   twc.productss   twc.DataEventLogs   DataEventLogs   twcWx.mappings   twcWxs	   twccommons   twccommon.Logs   Logs   twccommon.PluginManagers   PluginManagers   inits   Nones   loads   runs   ScheduleLoaders   CompositeSchedules   SingleSchedules   StaticSchedules   DynamicSchedules   productss   ProductLoaders   _ProdLoaders
   getAttribss	   _findFiles   _findInPaths	   _readFiles   _dsmgets   _buildBestSchedPresentationss   _buildSchedPresentationss   _buildViewportPresentations   _buildProductPresentations   _buildPresFiles   _buildRenderScriptFiles   _runRenderScriptFiless   _runRenderScriptFiles   _runUpdateSIDs   _flushs   _buildTestLogs   _buildRunLogs   _refreshMedias   _culls   _ROOTs	   _LOG_ROOTs   _pls
   _pluginMgrs   _presentationss   _runlog(-   s   loads   SingleSchedules   _dsmgets   Logs   _ROOTs   domestics   StaticSchedules   _buildRunLogs
   getAttribss   _buildProductPresentations   twcs   _buildSchedPresentationss   _ProdLoaders   _pls   _refreshMedias   twcWxs   _buildViewportPresentations   inits   dsms   _buildTestLogs   DataEventLogs   DynamicSchedules   _findInPaths   stats   runs	   _LOG_ROOTs   CompositeSchedules   _buildRenderScriptFiles   _buildPresFiles   syss   _flushs   _runRenderScriptFiles   dss	   _findFiles   PluginManagers   _runRenderScriptFiless   _presentationss   _runUpdateSIDs   ScheduleLoaders	   twccommons   times	   _readFiles   _buildBestSchedPresentationss   oss   _cull(    (    s   pm.pys   ? sb   3?

#[		"3				