a >h @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=())namerrstroptsselfr 8/usr/lib/python3.9/site-packages/sos/presets/__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__;s zPresetDefaults.__repr__cCs||_||_||_||_dS)zInitialise a new ``PresetDefaults`` object with the specified arguments. :returns: The newly initialised ``PresetDefaults`` Nrrrr )r rrrr r r r__init__BszPresetDefaults.__init__cCs|jrtd|j}|jt|jt|jt |ii}t j |sLt j |ddtt j ||jddd}t||Wdn1s0YdS)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 rwriteMs  zPresetDefaults.writecCsttj||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 rdeleteaszPresetDefaults.delete)__name__ __module__ __qualname____doc__rrrrr rrrrr'r)r r r rrs 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_priorityr)r$rZ sos.optionsrZ PRESETS_PATHrrrrZ NO_PRESETZNO_PRESET_DESCZNO_PRESET_NOTEZ SMALL_PRESETZSMALL_PRESET_DESCZSMALL_PRESET_NOTEZSMALL_PRESET_OPTSZGENERIC_PRESETSr r r r s2 R