-í
2Fc       s‰     d  k  Z   d  k Z  d  k Z  d  k Z  d  k Z  d  k Z 	 d  k Z 
 d  k Z  d  k Z  d  k Z	  d  k
 Z	  d  k Z	  d  k Z	  d  k Z	  d  k	 Z	  d  k Z  d  k Z  d  k Z  d k l Z  d  k Z  d  k Z  d  k Z  d k
 l Z  e	 i Z  e	 i Z  e	 i Z " d Z & e a ' e a  ( e i! ƒ  a" * g  a# / d f  d „  ƒ  YZ$ : d e i% i& i' f d „  ƒ  YZ( ` d „  Z) g d	 „  Z* l d
 „  Z+ q d „  Z, x d „  Z- ‹ d f  d „  ƒ  YZ. · d f  d „  ƒ  YZ/ 
d „  Z0 #d „  Z1 7d „  Z2 Md „  Z3 Td „  Z4 Æd „  Z5 ôe6 d j o õe  i7 e5 ƒ  ƒ n d  S(   N(   s   CORBA(   s
   ClientCorei   s   Commandc      s,   / 1 d Z  2 d Z 3 d Z 5 d „  Z RS(   Ni    i   i   c    s&   5 6 | |  _  7 |  i i | ƒ d  S(   N(   s   types   selfs   __dict__s   updates   kw(   s   selfs   types   kw(    (    s   main.pys   __init__5 s   (   s
   LOAD_CLOCKs   SET_TIMEs   LOAD_CLIMATOLOGY_DATAs   __init__(    (    (    s   main.pys   Command/ s   			s   Consumerc      s&   : d  Z  < > d „  Z [ d „  Z RS(   s0    CORBA proxy push consumer.  Handle events.
    c    s¥  > ? A | i ƒ  } B t | t i i i ƒ o C d  Sn E g  } F | i	 d j o: G t
 i i d | i	 f ƒ H | i t t i ƒ ƒ nÑ J | i	 d j o: K t
 i i d | i	 f ƒ L | i t t i ƒ ƒ n„ N | i	 d j op O t
 i i d | i	 f ƒ Q | i i d ƒ \ } } } R | i t t i d t | ƒ d t | ƒ ƒƒ n U t | ƒ d j o( V t ƒ  W t i | ƒ X t ƒ  n d  S(	   Ns
   Load.Clocks   received %s events
   SevereModes   Set.Times    s   newTimes   deltai    (   s   argss   values   events
   isinstances   twcs   corbas
   ClientCores   Events   cmdQueues   types	   twccommons   Logs   infos   appends   Commands
   LOAD_CLOCKs   splits   ts   msecs   deltas   SET_TIMEs   ints   lens   enterCriticalSections	   _cmdQueues   extends   exitCriticalSection(   s   selfs   argss   cmdQueues   msecs   ts   deltas   event(    (    s   main.pys   push> s&   	5
c    s   [ \ t  i i d ƒ d  S(   Ns   disconnected from event channel(   s	   twccommons   Logs   warn(   s   self(    (    s   main.pys   disconnect_push_consumer[ s   (   s   __doc__s   pushs   disconnect_push_consumer(    (    (    s   main.pys   Consumer: s   	c    s*   ` c t  i i d ƒ d t i d ƒ d  S(   Ns2   Warning: Process killed. The Clock is now stopped.i   (   s	   twccommons   Logs   errors   syss   exit(   s   signums   frame(    (    s   main.pys   signalHandler` s   c      s   g h i t  i ƒ  d  S(   N(   s   _locks   acquire(    (    (    s   main.pys   enterCriticalSectiong s   c      s   l m n t  i ƒ  d  S(   N(   s   _locks   release(    (    (    s   main.pys   exitCriticalSectionl s   c    sa   q r d t  i ƒ  d |  f } s t  i | d d ƒ} t t i i d | | f ƒ u | Sd  S(   Ns   Config.s   .Package.%ds   cachingEnabledi    s+   configureable package name lookup: %s -> %s(	   s   dsms   getConfigVersions   pkgNums   keys   gets   pkgNames	   twccommons   Logs   info(   s   pkgNums   pkgNames   key(    (    s   main.pys   Packageq s   c    sf   x y t  ƒ  } z h  } } | i | d <~ t | d <‚ t |  | | ƒ … | i ƒ  † ~ ˆ | Sd  S(   Ns   addCycles   Package(   s   Clocks   clocks   nss   addCycles   Packages   execfiles   fnames   clear(   s   fnames   nss   clock(    (    s   main.pys   execClockFilex s   	s   Eventc    	  s5   ‹ Œ e  e  e  e  e  e  e  d d „ Z ™ d „  Z RS(   Ni<   c    s   Œ Ž | |  _   | |  _  | |  _ ‘ | |  _ ’ | |  _ “ | |  _ ” |	 |  _ • |
 |  _ – | |  _	 — | |  _
 d  S(   N(   s   minutess   selfs   yearss   monthss   mdayss   hourss   wdayss   ydayss   durations   names   inst(   s   selfs   names   insts   minutess   yearss   monthss   mdayss   hourss   wdayss   ydayss   duration(    (    s   main.pys   __init__Œ s   c    sz  ™ œ |  i t j o  d Sn Ÿ |  i t j o | d |  i j o   d Sn ¢ |  i t j o | d |  i j o £ d Sn ¥ |  i t j o | d |  i j o ¦ d Sn ¨ |  i t j o | d |  i j o © d Sn « | d |  i j o ¬ d Sn ® |  i t j o | d |  i j o ¯ d Sn ± |  i	 t j o | d |  i	 j o ² d Sn ´ d Sd  S(   Ni    i   i   i   i   i   i   (
   s   selfs   minutess   Nones   yearss
   time_tuples   monthss   mdayss   hourss   wdayss   ydays(   s   selfs
   time_tuple(    (    s   main.pys   matches™ s"   ''''''(   s   Nones   __init__s   matches(    (    (    s   main.pys   Event‹ s   $s   Clockc      sG   · ¸ d „  Z  » e e e e e e d „ Z Ø d „  Z â d „  Z RS(   Nc    s   ¸ ¹ g  |  _ d  S(   N(   s   selfs   _event_list(   s   self(    (    s   main.pys   __init__¸ s   c    s"  » ½ t  } ¾ d } Â xÌ | DÂ ]Á } Ã t  } Æ x¬ | DÆ ]¡ }
 Ç |
 t  j oX È t |
 d |
 d | f É | | | | | | ƒ	 }	 Ê |	 } Ë |  i i d |	 ƒ n' Í | t  j o Î | i d 7_ n Ð | d 7} q; Wq WÒ | d j o' Ô t i i d | ƒ Õ t d ‚ n d  S(   Ni    i   i<   sE   addCycle expecting 60 minute block of programming and got %d instead.s"   addCycle expecting 60 minute block(   s   Nones   lastes   minutes   cycles   ss   ps   Events   yearss   monthss   mdayss   hourss   wdayss   ydayss   es   selfs   _event_lists   inserts   durations	   twccommons   Logs   errors   RuntimeError(   s   selfs   cycles   yearss   monthss   mdayss   hourss   wdayss   ydayss   lastes   es   ps   ss   minute(    (    s   main.pys   addCycle» s$   		
 		
 		c    sI   Ø Ú Ü x2 |  i DÜ ]$ } Ý | i | ƒ o Þ | Sn q Wà t Sd S(   sa   Calculates the next event.  
        Returns the next package and the number of packages skipped.N(   s   selfs   _event_lists   es   matchess
   time_tuples   None(   s   selfs
   time_tuples   e(    (    s   main.pys   eventAtØ s    	c    sS  â ä æ t  |  i ƒ d j o ç t d ‚ n ì t i | ƒ } í | d } ð | d t	 i
 j o ò | d | 7} n õ | d | 7} ø t i | ƒ } ù |  i | ƒ } ý d } þ xZ þ | o
 | t j oB ÿ | d 8}  | d 7} t i | ƒ } |  i | ƒ } q¾ W| t j o t d ‚ n | | t	 i
 | f Sd S(	   s\   Find the first event that can play after specified time.
        The preroll is factored in.i    s   the clock is empty, fool!i   i<   ix   i   s*   The clock has NO EVENTS for the next hour!N(   s   lens   selfs   _event_lists   RuntimeErrors   times	   localtimes   ts
   time_tuples   secondss   _configs   prerolls   eventAts   es	   loopLimits   None(   s   selfs   ts   es
   time_tuples	   loopLimits   seconds(    (    s   main.pys   findFirstEventâ s(   	 (   s   __init__s   Nones   addCycles   eventAts   findFirstEvent(    (    (    s   main.pys   Clock· s   
c    s½   
t  i  ƒ  } x— |  | d j o‚ t  i d ƒ t i ƒ  o t i ƒ  n t ƒ  t t	 ƒ } t ƒ  | d j o d Sn t  i  ƒ  } q W d Sd  S(   Nf0.20000000000000001i    i   (   s   times   nows
   event_times   sleeps   _orbs   work_pendings   perform_works   enterCriticalSections   lens	   _cmdQueues   numCommandss   exitCriticalSection(   s
   event_times   numCommandss   now(    (    s   main.pys
   sleepUntil
s    

c     sã   #$yš %t  i d d d ƒ} &t  i ƒ  } 'd | d t i } (d | d t i }  +| o ,t  i | d d ƒ} n .t  i |  d d ƒ} Wn5 0t
 j
 o& 1t i i d ƒ 2t i } n X4| Sd  S(   Ns
   SevereModes   cachingEnabledi    s   Config.s   .s+   missing data-store key; using default clock(   s   dsms   gets   svrModes   getConfigVersions   configVersions   _configs   clockFileKeys   severeModeClockFileKeys   svrModeClockFileKeys	   clockFiles   KeyErrors	   twccommons   Logs   infos   defaultClockFile(   s   svrModeClockFileKeys	   clockFiles   clockFileKeys   svrModes   configVersion(    (    s   main.pys   getCurrentClockFile#s   c  	   s  79t  i d t ƒ  } :t i i d | ƒ ;t | ƒ } >t	 t
 i
 ƒ  ƒ } ?| i | ƒ \ } } } B| | | f g } C| | i } Exb t t ƒ DE]Q } F| i t
 i | ƒ ƒ }  G| i |  | t  i | f ƒ H| |  i 7} q¥ WJ| | | | f Sd  S(   Ns   /s   loading clock file %s(   s   _configs   workDirs   getCurrentClockFiles	   clockFiles	   twccommons   Logs   infos   execClockFiles   clocks   ints   times   ts   findFirstEvents   events
   event_times
   start_times   caches   durations   ranges	   LOOKAHEADs   is   eventAts	   localtimes   es   appends   preroll(	   s   es
   event_times   clocks	   clockFiles
   start_times   caches   is   ts   event(    (    s   main.pys   loadNewClock7s    	 c    s5   MNt  i i d Pd Qt |  | | f ƒ ƒ d  S(   Ns   SystemEventChannels   playman.playCmd.pm.load(   s   twcs   MiscCorbaInterfaces   signalEvents   reprs   scheds	   startTimes   newClock(   s   scheds	   startTimes   newClock(    (    s   main.pys   presentPackageMs   c     sV  TUWd } Xt ƒ  \ } }  } } Yt t t t f \ } }
 } } Zt d „  |  ƒ } \xï\d oä_t | ƒ } b| occt ƒ  dt } eg  a ft ƒ  hx3| Dh](} i| i t i j oZ jy mt ƒ  \ } }
 } } Wn4 pt j
 o% } qt } rt i i d ƒ n Xn³ u| i t i j o‚ w| i | i ƒ \ } } } y| | j o
 zq· nG ~| | j  o d  Sn, …t! | i | ƒ t" i# j o †d  Sn n ‰t i i d | i ƒ q· Wn Ž| t j oc | | j oO ‘d } ’| } “| } ”|
 }  •| } –t } ˜t d „  |  ƒ } n n œ| o
 qc n ¡t d „  |  ƒ } ¢|  d }  ¤| d \ } } } ¥t i i( d | | | f ƒ ¨t) | | | ƒ ©d } ªt* i+ ƒ  ¯|  t, |  ƒ d }	 ±|	 d	 |	 d i. } ³| i0 t1 i2 | ƒ ƒ } µ|  i4 | | t" i# | f ƒ ¸|  d d |  d d	 f \ } } ¼| t j o» ½x± ½| | j  o  ¾|
 d }
 ¿|
 t, |
 ƒ d }	 À|	 d i. |	 d	 } Á| i0 t1 i2 | ƒ ƒ } Â|
 i4 | | t" i# | f ƒ Ã|
 d d |
 d d	 f \ } } q˜Wn qc Wd  S(
   Ni    c    s   Z|  d i |  d i f S(   Ni    (   s   es   names   inst(   s   e(    (    s   main.pys   <lambda>Zs    i   s+   error loading clock file; keeping old clocks!   unknown command type %d; ignoringc    s   ˜|  d i |  d i f S(   Ni    (   s   es   names   inst(   s   e(    (    s   main.pys   <lambda>˜s    c    s%   ¡|  d i |  d i |  d i f S(   Ni    (   s   es   names   insts   duration(   s   e(    (    s   main.pys   <lambda>¡s    s,   building presentation for %s.%d to run at %di   (6   s   clockChanges   loadNewClocks   clocks   caches
   event_times
   start_times   Nones   newclocks   newcaches   newevent_times   newstart_times   maps   upNexts
   sleepUntils   sleepCompleteds   enterCriticalSections	   _cmdQueues   cmdQueues   exitCriticalSections   cmds   types   Commands
   LOAD_CLOCKs	   Exceptions   es	   twccommons   Logs   errors   SET_TIMEs   findFirstEvents   newTimes   nets   nsts   abss   _configs   prerolls   scheds
   dbgPkgNames
   dbgPkgInsts   temps   infos   presentPackages   dss
   clearCaches   lens
   lastcacheds   durations   sts   eventAts   times	   localtimes	   nextevents   appends   newevent(   s   caches   scheds   upNexts   newevent_times
   start_times
   dbgPkgNames   sleepCompleteds   newevents   sts
   lastcacheds   newcaches   nets
   dbgPkgInsts   es   cmdQueues
   event_times   clocks   nsts   cmds   clockChanges	   nextevents   newstart_times   temps   newclock(    (    s   main.pys   runTs|   	! 

		

 		
 "						
 	 %  c  	   s  ÆÇÉt  i i d ƒ ÊyÂËt  i i d ƒ Ít i t i t i ƒ a	 Ît  i
 i t	 ƒ Ðt t i d ƒ Ñt i ƒ  a Ód t i f } Õt	 i | ƒ } Ö| i ƒ  } ×| i ƒ  } Øt ƒ  i ƒ  } Ù| i | ƒ Ût	 i d ƒ } Ü| i ƒ  } Ý| i ƒ  ßt  i! ƒ  àt  i" d ƒ át# i$ t i% g ƒ ãt& i' i! t( i) d d ƒ d ƒ åt i* d	 t i+ d
 }  çt& i, |  ƒ èt  i i d ƒ éx éd o êt- ƒ  q°Wìt  i. ƒ  íd SWn2 ït/ j
 o# } ðt  i i1 d ƒ ñd Sn Xd  S(   Ns   clocks   initializing...i   s   corbaname::localhost:4000#%ss   RootPOAs   /sunSafety/sunSafetyFactss   datas   .datas   /s   .pids
   running...i    s   fatal error; aborting:iÿÿÿÿ(2   s	   twccommons   Logs   setIdents   infos   CORBAs   ORB_inits   syss   argvs   ORB_IDs   _orbs   corbas   setOrbs   execfiles   Configs	   getValuess   _configs   channels
   channelIORs   string_to_objects   for_consumerss   admins   obtain_push_suppliers   suppliers   Consumers   _thiss   consumers   connect_push_consumers   resolve_initial_referencess   poas   _get_the_POAManagers
   poaManagers   activates   dss   inits   enableCachings   psps   setIncludePaths
   productDirs   wxscans   SunSafetyFactManagers   twcs   findRsrcs   pidFileNames   appNames   writePids   runs   uninits	   Exceptions   es   logCurrentException(	   s   pidFileNames   poas
   channelIORs   es   admins
   poaManagers   suppliers   consumers   channel(    (    s   main.pys   mainÆs@   # 
s   __main__(8   s   syss   oss   os.paths	   threadings   times	   tracebacks   signals   Configs   twc.DataStoreInterfaces   twcs	   twc.corbas   twc.dsmarshals   twc.MiscCorbaInterfaces   twc.psps   twccommon.Logs	   twccommons   wxscans   wxscan.SunSafetyFactManagers   omniORBs   CORBAs	   CosNamings   twccommon.corbas!   twccommon.corba.CosEventComm__POAs
   ClientCores   DataStoreInterfaces   dss	   dsmarshals   dsms   psps	   LOOKAHEADs   Nones   _orbs   _configs   Locks   _locks	   _cmdQueues   Commands   corbas   CosEventComm__POAs   PushConsumers   Consumers   signalHandlers   enterCriticalSections   exitCriticalSections   Packages   execClockFiles   Events   Clocks
   sleepUntils   getCurrentClockFiles   loadNewClocks   presentPackages   runs   mains   __name__s   exit(    s   exitCriticalSections   CORBAs	   tracebacks   runs
   ClientCores   Packages	   LOOKAHEADs   wxscans   syss   Commands   signalHandlers	   CosNamings   psps   Configs   dss   loadNewClocks   twcs   getCurrentClockFiles   enterCriticalSections   Consumers   signals   Clocks   presentPackages
   sleepUntils	   threadings   dsms	   twccommons   times   execClockFiles   mains   oss   Event(    (    s   main.pys   ? s^   				"&,Sr.