-
aEc       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 V 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# ?e d  Z$ Od   Z% ^d   Z& gd   Z' pd   Z( {d   Z) d   Z* d   Z+ d   Z, d   Z- e d  Z. d   Z/ d   Z0 d   Z1 d   Z2 (d   Z3 -d    Z4 2d!   Z5 >d" Z6 ?d# Z7 @e#   Z8 Ae a9 Bh  Z: C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  * + zy, | d j o - t i d |   / d  Sn 1 t i d t g  3 | t j o 4 g  } n 5 t	 i
 d |  d | d | 7 d | d | 8 d	 t i   | d
 9 d |  } : | t |  <= t i d |  | f  ? t |  }	 B t | |	  } C | t j o D t i d  E d  Sn I | | _ K g  }
 L x' | i DL ] } M |
 i | i  qQWP t |
  Wd  R S t   Xd  S(   Ni    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 presentation(   s   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   fnames   _runRenderScriptFiless   _flush(   s   ids   durations   expires	   scheduless   paramss   runlogEventss   vpPress   argDatas   presentationss   schedLoaderss   rsFiles(    (    s   pm.pys   load* s4   	 	c    s  V X t  |  } Y t  |  =[ | | _ \ | | _ ` g  }	 a x| i Da ]} b y c | t	 j o d | i
   } n f t i   } g | | _ h | | _ i | i |  k t | i d  \ } } l | | _ m t d   |  | _ o t | | i d | q d | i }
 r |	 i |
  Wn& t t j
 o u t i d  n XqH Wx y y t |	  Wn& z t j
 o { t i d  n X} t |  ~ t |   t     t!   d  S(   Ns   Run.rsc    s   m d |  S(   Ns   %s/incl(   s   e(   s   e(    (    s   pm.pys   <lambda>m s    s   paramss   runlogEventss   error building presentations   error running presentation("   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   _buildTestLogs   _buildRunLogs   _refreshMedias   _cull(   s   ids	   startTimes
   startFrames   paramss
   searchPaths   vpPress   pparamss   rsfnames   argDatas   rsFiless   fname(    (    s   pm.pys   runV s<   
	 	
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 :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    sa    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   pparamss	   twccommons   mergeStructss	   _findFiles   prodFiles
   searchPaths   maps   libPaths   inclPaths   prodInsts   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#t i i |  } $| | j o
 %q3 n 'd } (y= )t i |  t i } *|  i | j  o +d } n Wn -t j
 o .d } n X0| o( 1t  i d |  4| i |  n q3 W6x | D6] } 7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/   :;t  i i i |   <t i   |  _ d  S(   N(   s   twcs   productss   ProductLoaders   flushs   selfs   times
   _purgeTime(   s   self(    (    s   pm.pys   flush:s   (   s   __init__s   setDefaultParamss   getDefaultParamss   startProdTypes   loadProducts   _rmOldLocalModuless   flush(    (    (    s   pm.pys   _ProdLoader s   !c    s   ?@t  t i    } Ad d | d | |  f d | g } Ht i |  } I| o Jt
 i | | g  } n L| Sd  S(   Ns   Configs	   Config.%ds   Config.%d.%ss   Config.%d.Override(   s   ints   dsms   getConfigVersions
   cfgVersions   products   kls   twcs   getAttribLists
   fullParamss   paramss	   twccommons   mergeStructs(   s   products   paramss
   fullParamss
   cfgVersions   kl(    (    s   pm.pys
   getAttribs?s   '
c    s   OPd t  |  f t  g } Q| } Sxd St |  d j oM T| d d | } Ut i i	 |  o V| | f Sn X| d } q+ WZ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	   _findFileOs   	 c    sY   ^_xE |  D_]: } `d | | f } at i  i |  o b| Sn q Wdt Sd  S(   Ns   %s/%s(   s   paths   ps   fnames   fullnames   oss   existss   None(   s   paths   fnames   ps   fullname(    (    s   pm.pys   _findInPath^s   
 	c    s>   ght  |   } iz j| i   SWd  lm| i   Xd  S(   N(   s   files   fnames   fs   reads   close(   s   fnames   f(    (    s   pm.pys	   _readFilegs
   c    sL   pqt  } ry st i |   } Wn ut j
 o
 vn Xx| Sd  S(   N(   s   Nones   vals   dsms   defaultedGets   keys	   Exception(   s   keys   val(    (    s   pm.pys   _dsmgetps   	c    s   {|g  } ~x | D~] } y_ t i d |  |  i i   } t i	 |  | i
 |  i  } t |  |  SWn* t j
 o t i d |  n Xq Wt Sd  S(   Ns   building schedule %s...s   error building schedule %s:(   s   presentationss   schedLoaderss   schedLoaders   Logs   infos   argDatas   paramss   clones   _pls   setDefaultParamss   getSchedules   durations   schedules   _buildSchedPresentationss	   Exceptions   logCurrentExceptions   None(   s   argDatas   schedLoaderss   schedules   presentationss   paramss   schedLoader(    (    s   pm.pys   _buildBestSchedPresentations{s   	
 	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    s.  t  i   }	 | |	 _ g  |	 _ t i d |  |	 _ d | |  i	 f |	 i _
 |  i |	 i _ t d   |  |	 _ d } d } x | D] }
 t i d |
 i   |
 i   f  |
 i d | d | d | d	 |	 i d
 |	 i  t |  |	 |
  } | | i i   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   f S(   N(   s   es   getNames   getDuration(   s   e(    (    s   pm.pys   <lambda>s    i    s5   building presentation for product %s (duration=%s)...s	   startTimes   startFrameOffsets   prodTypes
   layerPropss   prodSchedulec    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   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   startFrameOffsets   runlogEventss	   startTimes   paramss   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!   t  i   t i   d  S(   N(   s   _pls   flushs   dss
   clearCache(    (    (    s   pm.pys   _flushs   c    sG  |  i   } | ` x |  i D] } | i   } t | | i |  | ` x | i D] } | i   } | ` t | | i i   |  t | d | i i     t | d | i i    !t | d | i i    ql Wq( W#d t | i f } $t i | d  } %| 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:   ()x- |  i D)] \ } } *t i | |  q Wd  S(   N(   s   argDatas   runlogEventss   ks   vs   _runlogs	   writeData(   s   argDatas   ks   v(    (    s   pm.pys   _buildRunLog(s    c      s   -/t  i i   d  S(   N(   s   twcWxs   mappings
   refreshAll(    (    (    s   pm.pys   _refreshMedia-s   c     s   23g  } 4t i   } 5xD t i   D5]3 \ }  } 6| | i j o 7| i |   n q+ W9x/ | D9]$ }  :t	 i
 d |   ;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   _cull2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   _flushs   _buildTestLogs   _buildRunLogs   _refreshMedias   _culls   _ROOTs	   _LOG_ROOTs   _pls
   _pluginMgrs   _presentationss   _runlog(,   s   loads   SingleSchedules   _dsmgets   Logs   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   _culls   ScheduleLoaders	   twccommons   times	   _readFiles   _buildBestSchedPresentationss   oss   _ROOT(    (    s   pm.pys   ? s`   ,/

#[		0				