Skip to content
Snippets Groups Projects
Commit 7cf228d5 authored by Daniele Nicolodi's avatar Daniele Nicolodi
Browse files

timetracking: Apply naming convention for class private variables

parent 88ea3a06
No related branches found
No related tags found
No related merge requests found
......@@ -262,11 +262,11 @@ class Day:
class Timesheet:
def __init__(self, month, data):
self.month = month
self.start = self.header
self.end = object()
self.days = defaultdict(Day)
self._month = month
self._start = self.header
self._end = object()
self._home_office_start = None
self.days = defaultdict(Day)
self.parse(data)
def __iter__(self):
......@@ -280,7 +280,7 @@ class Timesheet:
def footer(self):
line = next(self.tokens)
if line == '*** Ende Monatsjournal ***':
return self.end
return self._end
raise ValueError(line)
def tableheader(self):
......@@ -291,7 +291,7 @@ class Timesheet:
if re.match(r'\s+(anteilige\s+)?Wochensumme', line):
continue
if re.match(r'\s+Periodensumme', line):
return self.end
return self._end
if re.match(r'-+$', line):
continue
self.tokens.rewind()
......@@ -335,7 +335,7 @@ class Timesheet:
r'(?P<notes>[^|]+)\|'
r'(?:\s+(?P<expected>\d+\.\d+)\s+(?P<worked>\d+\.\d+)\s+(?P<difference>[-+]\d+\.\d+)\s+(?P<balance>[-+]\d+\.\d+))?$', line):
# entry
date = self.month.replace(day=int(m.group('day')))
date = self._month.replace(day=int(m.group('day')))
tin = datetime.strptime(m.group('tin'), '%H:%M') if m.group('tin') else None
tout = datetime.strptime(m.group('tout'), '%H:%M') if m.group('tout') else None
code = Code(m.group('code') or '')
......@@ -371,8 +371,8 @@ class Timesheet:
def parse(self, s):
self.tokens = Tokenizer(s)
f = self.start
while f is not self.end:
f = self._start
while f is not self._end:
f = f()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment