idSDdZ ddlZGddeZGddeZGddeZd ZGd d eZ Gd d eZ GddeZ GddeZ GddeZ GddeZdZGddeZGddeZGddeZy#e$rddlZYwxYw)zR This provides a restricted tag language to define the sosreport index/report NceZdZdZdZy)Nodec@tj|jSN)jsondumpsdataselfs 6/usr/lib/python3/dist-packages/sos/report/reporting.py__str__z Node.__str__szz$))$$cy)NFr nodes r can_addz Node.can_addsrN)__name__ __module__ __qualname__r rrrr rrs %rrceZdZdZy)Leafz0Marker class that can be added to a Section nodeN)rrr__doc__rrr rrs:rrc"eZdZdZdZdZdZy)Reportz?The root element of a report. This is a container for sections.ci|_yr)r r s r __init__zReport.__init__'s  rc"t|tSr) isinstanceSectionrs r rzReport.can_add*s$((rc||D]7}|j|s|j|j|j<9yr)rr namer nodesrs r addz Report.add-s3 1D||D!'+yy $))$ 1rNrrrrrrr%rrr rr$sI)1rrcJt|tr|S|jddS)z3returns a string text for a given unicode/str inpututf8ignorerstrdecode)ss r _decoder.3s!As#AD&()CDrc"eZdZdZdZdZdZy)r zeA section is a container for leaf elements. Sections may be nested inside of Report objects only.c2t||_i|_yr)r.r"r )r r"s r rzSection.__init__<sDM  rc"t|tSr)rrrs r rzSection.can_add@s$%%rc|D]S}|j|s|jj|jgj |jUyr)rr setdefaultADDS_TOappendr#s r r%z Section.addCsF ID||D! $$T\\26==diiH IrNr&rrr r r 8s&&Irr ceZdZdZdZy)Commandcommandsc>t||t|d|_y)N)r" return_codehrefr.r )r r"r:r;s r rzCommand.__init__Ms$T]$/$T], rNrrrr4rrrr r7r7Is G,rr7ceZdZdZdZy) CopiedFile copied_filesc<t|t|d|_yN)r"r;r<r r"r;s r rzCopiedFile.__init__W$T]$T], rNr=rrr r?r?Ss G,rr?ceZdZdZdZy) CreatedFile created_filesc<t|t|d|_yrBr<rCs r rzCreatedFile.__init__`rDrNr=rrr rFrF\s G,rrFceZdZdZdZy)Alertalertsc$t||_yrr<r contents r rzAlert.__init__iG$ rNr=rrr rJrJes G%rrJceZdZdZdZy)Notenotesc$t||_yrr<rMs r rz Note.__init__qrOrNr=rrr rQrQms G%rrQc$|jdS)a Return True if 'string' ends with a backslash, and False otherwise. Define this as a named function for no other reason than that pep8 now forbids binding of a lambda expression to a name: 'E731 do not assign a lambda expression, use a def' \)endswith)strings r ends_bsrXus ??4  rceZdZdZdZdZdZdZdZdZ dZ dZ d Z dZ d Zd Zeed dfeed dfeeddfeeddfeeddffZgZdZdZdZy)PlainTextReportz@Will generate a plain text report from a top_level Report objectz * %(name)sz ! %sz * %szLoaded Plugins:z {name} z{name}zH========================================================================z- commands executed:z- files copied:z- files created:z - alerts:z - notes:c^ttj|j|_yr)sorteddictitemsr report_data)r report_nodes r rzPlainTextReport.__init__s!$**[-=-=">?rc gx|_}t|jdkDr|j|j|j|jd}d}t|j }|j D]Q\}}||j j|z }|dz }||jzdk(s=||ksC||jz }S||jz }|j||j D]\}}|j|j|j|jj||jD]&\}} } } |j||j| | | (t|j dkDr|j|j dj#t%d|} | S)Nrr[)r"r\cJt|tr|S|jddS)Nr(r)r*)is r z)PlainTextReport.unicode..s" 1c0B1010Jr)line_buflenHEADERr5PLUGLISTHEADERrb PLUGLISTITEMformatPLUGLISTMAXITEMS PLUGLISTSEPPLUGLISTFOOTER PLUGDIVIDER PLUGINFORMAT subsectionsprocess_subsectionr4FOOTERjoinmap) r rilinerg plugcount section_name_section_contentstype_format_headerfooteroutputs r unicodezPlainTextReport.unicodes#%%   q OODKK ( ++, (() #// )OL! D%%,,,,? ?D FAD)))Q.Q](((  ) ###.2.>.> A *L* OOD,, - OOD--44,4G H262B2B A.w''(8%--(.A A A  q OODKK (C!L (*+ rc||vr|jj|t|j|dD] }|jj||z"t |dkDr|jj|yyy)Nc0t|tr|dSdS)Nr"r[)rr`)xs r rhz4PlainTextReport.process_subsection..sz!T/B!F)r)keyr)rir5r_getrj)r sectionrrrritems r ruz"PlainTextReport.process_subsections '> MM  (KK$J 5 $$Wt^4  5 F a $$V,  rN)rrrrrkrvLEAFALERTNOTErlrmrprorqrsrrr7r?rFrJrQrtrirrrurrr rZrZsJ F F D E D&NLKNLK $4b9 T/b9 d0b9 \b9 t[b9 KH@ D -rrZcveZdZdZdZdZdZdZdZdZ dZ dZ d Z d Z d Zd Zeed dfeeddfeeddfeeddfeeddffZy) HTMLReportz:Will generate a HTML report from a top_level Report objecta Sos System Report zz(
  • %(name)s
  • z
  • %s
  • z#

    Loaded Plugins:

    z& z r]z
    {name}
    z+

    Plugin {name}

    z
    z

    Commands executed:

      z
    z

    Files copied:

      z

      Files created:

        z

        Alerts:

          z

          Notes:

            N)rrrrrkrvrrrrlrmrprorqrsrrr7r?rFrJrQrtrrr rrsD FF 5D E D:Nrs 6 4 1T 1E IdI",d,,,,$,%D%%4%!H-fH-V##LsB BB