Commit 1bacf959 authored by Michal Čihař's avatar Michal Čihař

Explicit notion of abstract classes

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 3805ec70
......@@ -65,13 +65,13 @@ class Check(object):
'''
Check for single phrase, not dealing with plurals.
'''
return False
raise NotImplementedError()
def check_source(self, source, unit):
'''
Checks source string
'''
return False
raise NotImplementedError()
def check_chars(self, source, target, pos, chars):
'''
......@@ -130,6 +130,18 @@ class TargetCheck(Check):
'''
target = True
def check_source(self, source, unit):
'''
We don't check source strings here.
'''
return False
def check_single(self, source, target, unit, cache_slot):
'''
Check for single phrase, not dealing with plurals.
'''
raise NotImplementedError()
class SourceCheck(Check):
'''
......@@ -137,6 +149,18 @@ class SourceCheck(Check):
'''
source = True
def check_single(self, source, target, unit, cache_slot):
'''
We don't check target strings here.
'''
return False
def check_source(self, source, unit):
'''
Checks source string
'''
raise NotImplementedError()
class CountingCheck(TargetCheck):
'''
......
......@@ -40,6 +40,12 @@ class PluralsCheck(TargetCheck):
# Check for empty translation
return '' in targets
def check_single(self, source, target, unit, cache_slot):
'''
We don't check target strings here.
'''
return False
class ConsistencyCheck(TargetCheck):
'''
......@@ -72,3 +78,9 @@ class ConsistencyCheck(TargetCheck):
return True
return False
def check_single(self, source, target, unit, cache_slot):
'''
We don't check target strings here.
'''
return False
......@@ -206,6 +206,12 @@ class BaseFormatCheck(TargetCheck):
def is_position_based(self, string):
return True
def check_single(self, source, target, unit, cache_slot):
'''
We don't check target strings here.
'''
return False
class PythonFormatCheck(BaseFormatCheck):
'''
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment