View file File name : MenuEditor.cpython-36.pyc Content :3 0��G�G � @ sV d Z ddlT ddlT ddlT ddlT ddlT ddlZddlZddl Z G dd� d�Z dS )z CLass to edit XDG Menus � )�*Nc @ sR e Zd ZdOdd�ZdPdd�Zdd� ZdQd d �ZdRdd�ZdSd d�ZdTdd�Z dUdd�Z dVdd�ZdWdd�ZdXdd�Z dYdd�Zdd� Zdd� Zdd � Zd!d"� Zd#d$� Zd%d&� Zd'd(� Zd)d*� Zd+d,� Zd-d.� Zd/d0� Zd1d2� Zd3d4� ZdZd6d7�Zd8d9� Zd:d;� Zd[d=d>�Zd?d@� Z dAdB� Z!dCdD� Z"dEdF� Z#d\dGdH�Z$d]dIdJ�Z%dKdL� Z&dMdN� Z'dS )^� MenuEditorNFc C s* d | _ d | _d | _| j|||� g | _d S )N)�menu�filename�doc�parse� filenames)�selfr r �root� r � /usr/lib/python3.6/MenuEditor.py�__init__ s zMenuEditor.__init__c C s� |dkrt d� t|t�r"|| _n|r2t|�| _nt� | _|dkrN| jj| _n2|rZ|| _n&tjj t d dtjj| jj�d �| _ytj jj| j�| _W nT tk r� tj jjd| jj d �| _Y n& tjjjk r� td| j��Y nX | j| j� d S )NTr �menus� z�<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN" "http://standards.freedesktop.org/menu-spec/menu-1.0.dtd"><Menu><Name>Applications</Name><MergeFile type="parent">z</MergeFile></Menu>zNot a valid .menu file)ZsetRootMode� isinstance�Menur r �Filenamer �os�path�joinZxdg_config_dirs�split�xml�dom�minidomr �IOErrorZparseStringZparsersZexpatZ ExpatErrorZParsingError�$_MenuEditor__remove_whilespace_nodes)r r r r r r r r ! s&