GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Test Failed
Push — master ( 8a04f0...03c72a )
by P.R.
11:32
created

Event.fire()   A

Complexity

Conditions 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 9
rs 9.6666
1
"""
2
Enarksh
3
4
Copyright 2013-2016 Set Based IT Consultancy
5
6
Licence MIT
7
"""
8
9
10
class Event:
11
    """
12
    Class for events.
13
    """
14
15
    # ------------------------------------------------------------------------------------------------------------------
16
    event_controller = None
17
    """
18
    The event controller.
19
20
    :type: None|enarksh.event.EventController.EventController
21
    """
22
23
    # ------------------------------------------------------------------------------------------------------------------
24
    def __init__(self, source):
25
        """
26
        Object constructor.
27
28
        :param T source: The object that generates this event.
29
        """
30
        self._source = source
31
        """
32
        The object that generates this event.
33
34
        :type: enarksh.event.Actor.Actor
35
        """
36
37
        # Register this event as, well, an event in the current program.
38
        Event.event_controller.register_event(self)
39
40
    # ------------------------------------------------------------------------------------------------------------------
41
    def destroy(self):
42
        """
43
        Destroys this event.
44
        """
45
        # Remove this event as an event in the current program.
46
        Event.event_controller.unregister_event(self)
47
        self._source = None
48
49
    # ------------------------------------------------------------------------------------------------------------------
50
    @property
51
    def source(self):
52
        """
53
        Returns the object that generates this event.
54
55
        :rtype: enarksh.event.Actor.Actor
56
        """
57
        return self._source
58
59
    # ------------------------------------------------------------------------------------------------------------------
60
    def fire(self, event_data=None):
61
        """
62
        Fires this event. That is, the event is put on the event queue of the event controller.
63
64
        Normally this method is called by the source of this event.
65
66
        :param * event_data: Additional data supplied by the event source.
67
        """
68
        Event.event_controller.queue_event(self, event_data)
69
70
    # ------------------------------------------------------------------------------------------------------------------
71
    def register_listener(self, listener, listener_data=None):
72
        """
73
        Registers an object as a listener for this event.
74
75
        :param * listener: An object that listen for an event.
76
        :param * listener_data: Additional data supplied by the listener destination.
77
        """
78
        Event.event_controller.register_listener(self, listener, listener_data)
79
80
# ----------------------------------------------------------------------------------------------------------------------
81