Completed
Push — master ( 0c702e...f32b73 )
by P.R.
01:15
created

Reader.next()   A

Complexity

Conditions 1

Size

Total Lines 6

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 6
rs 9.4285
1
"""
2
ETLT
3
4
Copyright 2016 Set Based IT Consultancy
5
6
Licence MIT
7
"""
8
import abc
9
10
11
class Reader:
1 ignored issue
show
Unused Code introduced by
This abstract class does not seem to be used anywhere.
Loading history...
12
    """
13
    Abstract parent class for reading (directly or indirectly) rows from the source.
14
    """
15
16
    # ------------------------------------------------------------------------------------------------------------------
17
    def __init__(self):
18
        """
19
        Object constructor.
20
        """
21
        self._row_number = -1
22
        """
23
        The row number for identifying the row in the source data.
24
25
        :type: int
26
        """
27
28
    # ------------------------------------------------------------------------------------------------------------------
29
    @property
30
    def row_number(self):
31
        """
32
        Getter for row count.
33
34
        :rtype: int
35
        """
36
        return self._row_number
37
38
    # ------------------------------------------------------------------------------------------------------------------
39
    @abc.abstractmethod
40
    def get_source_name(self):
41
        """
42
        Returns a name for identifying the current source.
43
44
        :rtype: str
45
        """
46
        raise NotImplementedError()
47
48
    # ------------------------------------------------------------------------------------------------------------------
49
    @abc.abstractmethod
50
    def next(self):
51
        """
52
        Yields the next row from the source.
53
        """
54
        raise NotImplementedError()
55
56
# ----------------------------------------------------------------------------------------------------------------------
57