Current Path : /usr/lib/python2.7/dist-packages/LanguageSelector/ |
Current File : //usr/lib/python2.7/dist-packages/LanguageSelector/utils.pyc |
ó S¯/Oc @ s@ d d l Z d d l Z d d l Z e e d „ Z d „ Z d S( iÿÿÿÿNc C s) x"| D]} t j d t d t j j | ƒ ƒ } t } t j j | ƒ r× t j | t j ƒ r× xv t | ƒ D]e } | j ƒ } | r¡ | j | ƒ r¡ t } | } n | rà | | k rà t } | } n | j | ƒ qk Wn | rô | rô | j | ƒ n | j ƒ t j | j | ƒ t j | d ƒ q Wd S( sY find all strings that startswith findString and replace them with setString t deletet diri¤ N( t tempfilet NamedTemporaryFilet Falset ost patht dirnamet existst accesst R_OKt opent stript startswitht Truet writet flusht renamet namet chmod( t findStringt setStringt file_listR t appendt fnamet outt foundStringt linet tmp( ( s: /usr/lib/python2.7/dist-packages/LanguageSelector/utils.pyt find_string_and_replace s( c C s2 | j d ƒ d } t j d | g ƒ } | j ƒ S( s9 generate locale name for LC_* environment variables t :i s) /usr/share/language-tools/language2locale( t splitt subprocesst check_outputt rstrip( t languaget first_elemt locale( ( s: /usr/lib/python2.7/dist-packages/LanguageSelector/utils.pyt language2locale( s ( R R R R R R&