File: result.py

package info (click to toggle)
python-jenkinsapi 0.3.14-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 420 kB
  • sloc: python: 4,241; makefile: 3
file content (27 lines) | stat: -rw-r--r-- 617 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""
Module for jenkinsapi Result
"""


class Result(object):
    """
    Result class
    """

    def __init__(self, **kwargs):
        self.__dict__.update(kwargs)

    def __str__(self):
        return f"{self.className} {self.name} {self.status}"

    def __repr__(self) -> str:
        module_name = self.__class__.__module__
        class_name = self.__class__.__name__
        self_str = str(self)
        return "<%s.%s %s>" % (module_name, class_name, self_str)

    def identifier(self) -> str:
        """
        Calculate an ID for this object.
        """
        return f"{self.className}.{self.name}"