• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

eronnen / procmon-parser / 4627113288

pending completion
4627113288

Pull #30

github

GitHub
Merge 01754fdd4 into ec8666638
Pull Request #30: fix Rule class repr

1 of 1 new or added line in 1 file covered. (100.0%)

1502 of 1596 relevant lines covered (94.11%)

0.94 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.48
/procmon_parser/configuration.py
1
"""
1✔
2
Python types that procmon configuration uses
3
"""
4

5
from six import string_types
1✔
6

7
from procmon_parser.consts import Column, RuleAction, RuleRelation
1✔
8

9
__all__ = ['Column', 'RuleAction', 'RuleRelation', 'Rule', 'Font']
1✔
10

11

12
class Rule(object):
1✔
13
    """A rule that can be used to filter procmon events.
1✔
14
    """
15

16
    def __init__(self, column=Column.ARCHITECTURE, relation=RuleRelation.IS, value="64-bit", action=RuleAction.INCLUDE):
1✔
17
        self.column = Column[column.upper()] if isinstance(column, string_types) else Column(column)
1✔
18
        self.relation = RuleRelation[relation.upper()] if isinstance(relation, string_types) else RuleRelation(relation)
1✔
19
        if not isinstance(value, string_types):
1✔
20
            raise TypeError("Filter value must be a string")
1✔
21
        self.value = value
1✔
22
        self.action = RuleAction[action.upper()] if isinstance(action, string_types) else RuleAction(action)
1✔
23

24
    def __eq__(self, other):
1✔
25
        if type(other) is type(self):
1✔
26
            return self.__dict__ == other.__dict__
1✔
27
        return False
×
28

29
    def __ne__(self, other):
1✔
30
        return not self.__eq__(other)
1✔
31

32
    def __str__(self):
1✔
33
        return "If {} {} \"{}\", then {}".format(self.column.name.capitalize(), self.relation.name.lower(), self.value,
×
34
                                                 self.action.name.capitalize())
35

36
    def __repr__(self):
1✔
37
        return "Rule(Column.{}, Relation.{}, \"{}\", Action.{})".format(self.column.name, self.relation.name,
×
38
                                                                        self.value, self.action.name)
39

40
    def __hash__(self):
1✔
41
        return hash((self.column.value, self.relation.value, self.value, self.action.value))
×
42

43

44
class Font(object):
1✔
45
    """A font attributes for procmon, like in LOGFONTW structure
1✔
46
    see https://docs.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-logfontw for documentation
47
    """
48

49
    def __init__(self, height=8, width=0, escapement=0, orientation=0, weight=0, italic=0, underline=0, strikeout=0,
1✔
50
                 char_set=0, out_precision=0, clip_precision=0, quality=0, pitch_and_family=0,
51
                 face_name="MS Shell Dlg"):
52
        self.height = height
1✔
53
        self.width = width
1✔
54
        self.escapement = escapement
1✔
55
        self.orientation = orientation
1✔
56
        self.weight = weight
1✔
57
        self.italic = italic
1✔
58
        self.underline = underline
1✔
59
        self.strikeout = strikeout
1✔
60
        self.char_set = char_set
1✔
61
        self.out_precision = out_precision
1✔
62
        self.clip_precision = clip_precision
1✔
63
        self.quality = quality
1✔
64
        self.pitch_and_family = pitch_and_family
1✔
65
        self.face_name = face_name
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc