korsygfhrtzangaiide
Elepffwdsff
/
usr
/
share
/
dstat
/
Upload FileeE
HOME
� ;�qKc @ s d e f d � � YZ d S( t dstat_pluginc B s2 e Z d Z d � Z d � Z d � Z d � Z RS( s� Remaining battery time. Calculated from power drain and remaining battery power. Information is retrieved from ACPI. c C s( d | _ d | _ d | _ d | _ d S( Nt remaint ti i ( t namet typet widtht scale( t self( ( s( /usr/share/dstat/dstat_battery_remain.pyt __init__ s c C s� g } x� t j d � D] } xv t d | d � j � D]Z } | j � } t | � d k ra q7 n | d d k r7 | d d k r7 | j | � q7 q7 Wq W| j � | S( Ns /proc/acpi/battery/s /statei i s present:i t yes( t ost listdirt dopent readlinest splitt lent appendt sort( R t rett batteryt linet l( ( s( /usr/share/dstat/dstat_battery_remain.pyt vars s ! c C s g | j D] } | j � ^ q S( N( R t lower( R R ( ( s( /usr/share/dstat/dstat_battery_remain.pyt nick s c C s� x� | j D]� } x� t d | d � j � D]� } | j � } t | � d k rU q+ n | d d !d d g k r� t | d � } q+ q+ | d d !d d g k r+ t | d � } q+ q+ q+ W| r� | r� | d | | j | <q d | j | <q Wd S( Ns /proc/acpi/battery/s /statei i i t remainings capacity:t presents rate:i<