ó
dŮÉ]c           @   s   d  Z  d d l Z d   Z d S(   s˙  
Determine rudimentary package and version information for click packages to
enable bucketing on the Error Tracker.

Copyright (C) 2014 Canonical Ltd.
Author: Brian Murray <brian@canonical.com>

This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.  See http://www.gnu.org/copyleft/gpl.html for
the full text of the license.
i˙˙˙˙Nc   	      C   sx  |  j  d  } | s d  S| j d  r= | j d  r= d  Sd |  d <t j d d | g d t j d	 t } | j   d
 } xË | j   D]˝ } d | k rÎ | j d  j	 d  d } | j
 d d  } n  d | k r| j d  j	 d  d } | j
 d d  } n  d | k r | j d  j	 d  d } | j
 d d  } q q Wd | | f |  d <| |  d <| |  d <d  S(   Nt   ExecutablePaths   /opt/click.ubuntu.coms   /usr/share/click/preinstalledt   Truet   ClickPackaget   clickt   infot   stdoutt   universal_newlinesi    t   names    ,s   : i   t   "t    t   versiont   architectures   %s %st   Packaget   SourcePackaget   PackageArchitecture(   t   gett
   startswitht
   subprocesst   Popent   PIPER   t   communicatet
   splitlinest   stript   splitt   replace(	   t   reportt   uit	   exec_patht
   click_infot   outt   linet   packageR
   t   pkg_arch(    (    s,   /usr/share/apport/general-hooks/clickinfo.pyt   add_info   s0    
		
(   t   __doc__R   R!   (    (    (    s,   /usr/share/apport/general-hooks/clickinfo.pyt   <module>   s   