Total Complexity | 2 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Coverage | 100% |
1 | # -*- coding: utf-8 -*- |
||
8 | 1 | class SeasonParser(ValuesParser): |
|
9 | """ |
||
10 | Parses ``SEASON`` section. |
||
11 | View :ref:`detailed description <season-section>`. |
||
12 | """ |
||
13 | |||
14 | 1 | def check_section_name(self, section_name): |
|
15 | """ |
||
16 | Implements abstract method. See |
||
17 | :meth:`SectionParser.check_section_name` for semantics. |
||
18 | """ |
||
19 | 1 | return section_name == "SEASON" |
|
20 | |||
21 | 1 | def clean(self): |
|
22 | """ |
||
23 | Redefines base method. See :meth:`SectionParser.clean` for |
||
24 | semantics. |
||
25 | |||
26 | Combines day, time and year into :class:`datetime.date` object. |
||
27 | """ |
||
28 | 1 | date = datetime.date(int(self.data['Year']), |
|
29 | int(self.data['Month']), |
||
30 | int(self.data['Day'])) |
||
31 | return {'date': date, } |
||
32 |