
    -.fJ                     v    d dl Z d dlZd dlZd dlZ ej                  d      Z ej                  d      ZdZd Zy)    Nz^\s*\d+\s*\[Modem\s*\]z^card [0-9].*[mM]odemzsl-modem-daemonc                 d   	 t        d      5 }|D ])  }t        j                  |      st        gc cd d d        S  	 d d d        	 t        j                  j                         }	 |d= d|d<   	 t        j                  ddg|t        j                  t        j                  d	      }|j                         \  }}|j                  d
k7  r%t        j                   d|j                  |fz         y 	 |j'                         D ]   }t(        j                  |      st        gc S  y # 1 sw Y   xY w# t        $ r!}t        j                  d|       Y d }~d }~ww xY w# t        $ r Y w xY w# t"        $ r t        j                   d       Y y w xY w# t$        $ r t        j                  d       Y y w xY w)Nz/proc/asound/cardsz%could not open /proc/asound/cards: %sLANGUAGECLC_ALLaplayz-lT)envstdoutstderruniversal_newlinesr   zaplay -l failed with %i: %szaplay command not foundz4could not open aplay -l. Skipping sl-modem detection)openmodem_rematchpkgIOErrorloggingdebugosenvironcopyKeyError
subprocessPopenPIPEcommunicate
returncodeerrorFileNotFoundErrorOSError
splitlinesmodem_as_subdevice_re)		apt_cachefdlineer   r   	aplay_out	aplay_errrows	            3/usr/share/ubuntu-drivers-common/detect/sl-modem.pydetectr)      s   B&' 	!2 !>>$'5L	! 	!!	!jjoo	J H	$$$S!z#')E &+%6%6%8"Y	1$;u?O?O'?) ) * % ##%  &&s+5L K	! 	!  B=qAAB  		 ! 	MM34	  LMs   D. D"D"	D. D"D. F %E (F .A>E* "D+'D. .	E7EE	E'$F &E''F *FF 
FF F/.F/)	r   rer   r   compiler   r    r   r)        r(   <module>r.      s@    
 	  2::/0"

#;< (r-   