{
    "content": [
        {
            "type": "text",
            "text": "# problem_report (pydoc)\n\n**Summary:** problemreport - Store, load, and handle problem reports.\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **CLASSES** (5 lines) — 2 subsections\n  - class CompressedValue (33 lines)\n  - class ProblemReport (231 lines)\n- **FILE** (3 lines)\n\n## Full Content\n\n### NAME\n\nproblemreport - Store, load, and handle problem reports.\n\n### CLASSES\n\nbuiltins.object\nCompressedValue\ncollections.UserDict(collections.abc.MutableMapping)\nProblemReport\n\n#### class CompressedValue\n\n|  CompressedValue(value=None, name=None)\n|\n|  Represent a ProblemReport value which is gzip compressed.\n|\n|  Methods defined here:\n|\n|  init(self, value=None, name=None)\n|      Initialize an empty CompressedValue object with an optional name.\n|\n|  len(self)\n|      Return length of uncompressed value.\n|\n|  getvalue(self)\n|      Return uncompressed value.\n|\n|  setvalue(self, value)\n|      Set uncompressed value.\n|\n|  splitlines(self)\n|      Behaves like splitlines() for a normal string.\n|\n|  write(self, file)\n|      Write uncompressed value into given file-like object.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n\n#### class ProblemReport\n\n|  ProblemReport(type='Crash', date=None)\n|\n|  Method resolution order:\n|      ProblemReport\n|      collections.UserDict\n|      collections.abc.MutableMapping\n|      collections.abc.Mapping\n|      collections.abc.Collection\n|      collections.abc.Sized\n|      collections.abc.Iterable\n|      collections.abc.Container\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  init(self, type='Crash', date=None)\n|      Initialize a fresh problem report.\n|\n|      type can be 'Crash', 'Packaging', 'KernelCrash' or 'KernelOops'.\n|      date is the desired date/time string; if None (default), the\n|      current local time is used.\n|\n|  setitem(self, k, v)\n|\n|  addtoexisting(self, reportfile, keeptimes=False)\n|      Add this report's data to an already existing report file.\n|\n|      The file will be temporarily chmod'ed to 000 to prevent frontends\n|      from picking up a hal-updated report file. If keeptimes\n|      is True, then the file's atime and mtime restored after updating.\n|\n|  extractkeys(self, file, binkeys, dir)\n|      Extract only one binary element from the problemreport\n|\n|      Binary elements like kernel crash dumps can be very big. This method\n|      extracts directly files without loading the report into memory.\n|\n|  gettimestamp(self) -> int\n|      Get timestamp (seconds since epoch) from Date field\n|\n|      Return None if it is not present.\n|\n|  hasremovedfields(self)\n|      Check if the report has any keys which were not loaded.\n|\n|      This could happen when using binary=False in load().\n|\n|  load(self, file, binary=True, keyfilter=None)\n|      Initialize problem report from a file-like object.\n|\n|      If binary is False, binary data is not loaded; the dictionary key is\n|      created, but its value will be an empty string. If it is True, it is\n|      transparently uncompressed and available as dictionary byte array values.\n|      If binary is 'compressed', the compressed value is retained, and the\n|      dictionary value will be a CompressedValue object. This is useful if\n|      the compressed value is still useful (to avoid recompression if the\n|      file needs to be written back).\n|\n|      file needs to be opened in binary mode.\n|\n|      If keyfilter is given, only those keys will be loaded.\n|\n|      Files are in RFC822 format, but with case sensitive keys.\n|\n|  newkeys(self)\n|      Return newly added keys.\n|\n|      Return the set of keys which have been added to the report since it\n|      was constructed or loaded.\n|\n|  write(self, file, onlynew=False)\n|      Write information into the given file-like object.\n|\n|      If onlynew is True, only keys which have been added since the last\n|      load() are written (i. e. those returned by newkeys()).\n|\n|      If a value is a string, it is written directly. Otherwise it must be a\n|      tuple of the form (file, encode=True, limit=None, failonempty=False).\n|      The first argument can be a file name or a file-like object,\n|      which will be read and its content will become the value of this key.\n|      'encode' specifies whether the contents will be\n|      gzip compressed and base64-encoded (this defaults to True). If limit is\n|      set to a positive integer, the file is not attached if it's larger\n|      than the given limit, and the entire key will be removed. If\n|      failonempty is True, reading zero bytes will cause an IOError.\n|\n|      file needs to be opened in binary mode.\n|\n|      Files are written in RFC822 format.\n|\n|  writemime(self, file, attachtreshold=5, extraheaders={}, skipkeys=None, priorityfields=None)\n|      Write MIME/Multipart RFC 2822 formatted data into file.\n|\n|      file must be a file-like object, not a path.  It needs to be opened in\n|      binary mode.\n|\n|      If a value is a string or a CompressedValue, it is written directly.\n|      Otherwise it must be a tuple containing the source file and an optional\n|      boolean value (in that order); the first argument can be a file name or\n|      a file-like object, which will be read and its content will become the\n|      value of this key.  The file will be gzip compressed, unless the key\n|      already ends in .gz.\n|\n|      attachtreshold specifies the maximum number of lines for a value to be\n|      included into the first inline text part. All bigger values (as well as\n|      all non-ASCII ones) will become an attachment, as well as text\n|      values bigger than 1 kB.\n|\n|      Extra MIME preamble headers can be specified, too, as a dictionary.\n|\n|      skipkeys is a set/list specifying keys which are filtered out and not\n|      written to the destination file.\n|\n|      priorityfields is a set/list specifying the order in which keys should\n|      appear in the destination file.\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes defined here:\n|\n|  abstractmethods = frozenset()\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from collections.UserDict:\n|\n|  contains(self, key)\n|      # Modify contains to work correctly when missing is present\n|\n|  copy(self)\n|\n|  delitem(self, key)\n|\n|  getitem(self, key)\n|\n|  ior(self, other)\n|\n|  iter(self)\n|\n|  len(self)\n|\n|  or(self, other)\n|      Return self|value.\n|\n|  repr(self)\n|      Return repr(self).\n|\n|  ror(self, other)\n|      Return value|self.\n|\n|  copy(self)\n|\n|  ----------------------------------------------------------------------\n|  Class methods inherited from collections.UserDict:\n|\n|  fromkeys(iterable, value=None) from abc.ABCMeta\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from collections.UserDict:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from collections.abc.MutableMapping:\n|\n|  clear(self)\n|      D.clear() -> None.  Remove all items from D.\n|\n|  pop(self, key, default=<object object at 0x7ffaefd20190>)\n|      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.\n|      If key is not found, d is returned if given, otherwise KeyError is raised.\n|\n|  popitem(self)\n|      D.popitem() -> (k, v), remove and return some (key, value) pair\n|      as a 2-tuple; but raise KeyError if D is empty.\n|\n|  setdefault(self, key, default=None)\n|      D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D\n|\n|  update(self, other=(), /, kwds)\n|      D.update([E, ]F) -> None.  Update D from mapping/iterable E and F.\n|      If E present and has a .keys() method, does:     for k in E: D[k] = E[k]\n|      If E present and lacks .keys() method, does:     for (k, v) in E: D[k] = v\n|      In either case, this is followed by: for k, v in F.items(): D[k] = v\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from collections.abc.Mapping:\n|\n|  eq(self, other)\n|      Return self==value.\n|\n|  get(self, key, default=None)\n|      D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.\n|\n|  items(self)\n|      D.items() -> a set-like object providing a view on D's items\n|\n|  keys(self)\n|      D.keys() -> a set-like object providing a view on D's keys\n|\n|  values(self)\n|      D.values() -> an object providing a view on D's values\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes inherited from collections.abc.Mapping:\n|\n|  hash = None\n|\n|  reversed = None\n|\n|  ----------------------------------------------------------------------\n|  Class methods inherited from collections.abc.Collection:\n|\n|  subclasshook(C) from abc.ABCMeta\n|      Abstract classes can override this to customize issubclass().\n|\n|      This is invoked early on by abc.ABCMeta.subclasscheck().\n|      It should return True, False or NotImplemented.  If it returns\n|      NotImplemented, the normal algorithm is used.  Otherwise, it\n|      overrides the normal algorithm (and the outcome is cached).\n|\n|  ----------------------------------------------------------------------\n|  Class methods inherited from collections.abc.Iterable:\n|\n|  classgetitem = GenericAlias(...) from abc.ABCMeta\n|      Represent a PEP 585 generic type\n|\n|      E.g. for t = list[int], t.origin is list and t.args is (int,).\n\n### FILE\n\n/usr/lib/python3/dist-packages/problemreport.py\n\n"
        }
    ],
    "structuredContent": {
        "command": "problem_report",
        "section": "",
        "mode": "pydoc",
        "summary": "problemreport - Store, load, and handle problem reports.",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "CLASSES",
                "lines": 5,
                "subsections": [
                    {
                        "name": "class CompressedValue",
                        "lines": 33
                    },
                    {
                        "name": "class ProblemReport",
                        "lines": 231
                    }
                ]
            },
            {
                "name": "FILE",
                "lines": 3,
                "subsections": []
            }
        ]
    }
}