3 ܓi @sddlZddlZddlmZdZdZdZdZGdddZd Z d Z d Z d Z d Z dZeddddddZe ee e e ede ee e eediZdS)N) SoSOptionsz/etc/sos/presets.ddescnoteargsc@sZeZdZdZdZdZdZeZdZ ddZ ddZ dddefd d Z d d Z d dZdS)PresetDefaultsaPreset command line defaults to allow for quick reference to sets of commonly used options :param name: The name of the new preset :type name: ``str`` :param desc: A description for the new preset :type desc: ``str`` :param note: Note for the new preset :type note: ``str`` :param opts: Options set for the new preset :type opts: ``SoSOptions`` NTc Cs*d|jd|jd|jdt|jd S)zeReturn a human readable string representation of this ``PresetDefaults`` object. zname=z desc=z note=z opts=())namerrstropts)selfr /usr/lib/python3.6/__init__.py__str__4szPresetDefaults.__str__c Cs*d|jd|jd|jdt|jd S)zgReturn a machine readable string representation of this ``PresetDefaults`` object. zPresetDefaults(name='z' desc='z' note='z' opts=(r)rrrreprr )r r r r __repr__;szPresetDefaults.__repr__cCs||_||_||_||_dS)zInitialise a new ``PresetDefaults`` object with the specified arguments. :returns: The newly initialised ``PresetDefaults`` N)rrrr )r rrrr r r r __init__BszPresetDefaults.__init__c Cs|jrtd|jj}|jt|jt|jt |ii}t j j |sLt j |ddtt j j||jddd}tj||WdQRXdS)zWrite this preset to disk in JSON notation. :param presets_path: the directory where the preset will be written :type presets_path: ``str`` zCannot write built-in preseti)modewzutf-8)encodingN)builtin TypeErrorr dictrDESCrNOTErOPTSospathexistsmakedirsopenjoinjsondump)r presets_pathZodictZpdictZpfiler r r writeMs   zPresetDefaults.writecCstjtjj||jdS)zDelete a preset from disk :param presets_path: the directory where the preset is saved :type presets_path: ``str`` N)runlinkrr!r)r r$r r r deleteaszPresetDefaults.delete)__name__ __module__ __qualname____doc__rrrrr rrrrr%r'r r r r rs rZnonezDo not load a presetz+Use to disable automatically loaded presetsZminimalzCSmall and quick report that reduces sos report resource consumptionzXMay be useful for low-resource systems, but may not provide sufficient data for analysis T)Zlog_sizeZ journal_sizeZplugin_timeoutZcommand_timeoutZ low_priority)rrrr )r"rZ sos.optionsrZ PRESETS_PATHrrrrZ NO_PRESETZNO_PRESET_DESCZNO_PRESET_NOTEZ SMALL_PRESETZSMALL_PRESET_DESCZSMALL_PRESET_NOTEZSMALL_PRESET_OPTSZGENERIC_PRESETSr r r r  s* R