| Server IP : 182.53.201.61 / Your IP : 216.73.217.175 Web Server : Apache/2.2.15 (Fedora) System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686 User : apache ( 48) PHP Version : 5.3.3 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/lib/python2.6/site-packages/orca/ |
Upload File : |
z#Jc @ s d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k l Z d Z d Z
d Z d Z d Z
d Z d Z d d
d
YZ d d d YZ d S( iN( t _i i i i i- i t
PriorityQueuec B s_ e Z d Z d Z d Z d Z d Z d Z d Z d Z d Z
d Z RS(
s This class represents a thread **UNSAFE** priority queue where priority
is determined by the given integer priority. The entries are also
maintained in chronological order.
TODO: experiment with Queue.Queue to make thread safe
c C s
g | _ d S( N( t queue( t self( ( s4 /usr/lib/python2.6/site-packages/orca/liveregions.pyt __init__ s c C s) t i | i | t i | | f d S( sS Add a new element to the queue according to 1) priority and
2) timestamp. N( t bisectt insort_leftR t time( R t datat priorityt obj( ( s4 /usr/lib/python2.6/site-packages/orca/liveregions.pyt enqueue# s c C s | i i d S( s2 get the highest priority element from the queue. i ( R t pop( R ( ( s4 /usr/lib/python2.6/site-packages/orca/liveregions.pyt dequeue( s c C s
g | _ d S( s Clear the queue N( R ( R ( ( s4 /usr/lib/python2.6/site-packages/orca/liveregions.pyt clear, s c s4 t i f d } t | | i | _ d S( sL Purge items from the queue that are older than the keepalive
time c s | d t j S( i ( t MSG_KEEPALIVE_TIME( t item( t currenttime( s4 /usr/lib/python2.6/site-packages/orca/liveregions.pyt <lambda>4 s N( R t filterR ( R t myfilter( ( R s4 /usr/lib/python2.6/site-packages/orca/liveregions.pyt purgeByKeepAlive0 s c s( f d } t | | i | _ d S( se Purge items from the queue that have a lower than or equal priority
than the given argument c s | d j S( i ( ( R ( R ( s4 /usr/lib/python2.6/site-packages/orca/liveregions.pyR : s N( R R ( R R R ( ( R s4 /usr/lib/python2.6/site-packages/orca/liveregions.pyt purgeByPriority7 s c C s t | i o g } | i | i d | d d d } | d d d } x| t d t | i D]b } | i | d d | j o, | d d d i | i | d d qg | i | i | qg W| | _ n d S( s Combines messages with the same 'label' by appending newer
'content' and removing the newer message. This operation is only
applied to the next dequeued message for performance reasons and is
often applied in conjunction with filterContents() i i t labelst contenti N( t lenR t appendt ranget extend( R t newqueuet targetlabelst
targetcontentt i( ( s4 /usr/lib/python2.6/site-packages/orca/liveregions.pyt
clumpContents= s c C s: t | i d d d d j o| i d d d } | d g } x t d t | D] } t } x t t | D] } | | i | | d j p | | i | | d j o>