Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
53478f8d
Commit
53478f8d
authored
Jan 25, 2016
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Factor out check skip decision
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
6cc09d63
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
weblate/trans/checks/base.py
weblate/trans/checks/base.py
+11
-5
No files found.
weblate/trans/checks/base.py
View file @
53478f8d
...
...
@@ -41,6 +41,16 @@ class Check(object):
self
.
enable_string
=
id_dash
self
.
ignore_string
=
'ignore-%s'
%
id_dash
def
should_skip
(
self
,
unit
):
"""Check whether we should skip processing this unit"""
# Is this disabled by default
if
self
.
default_disabled
and
self
.
enable_string
not
in
unit
.
all_flags
:
return
True
# Is this check ignored
if
self
.
ignore_string
in
unit
.
all_flags
:
return
True
return
False
def
check_target
(
self
,
sources
,
targets
,
unit
):
'''
Checks target strings.
...
...
@@ -49,11 +59,7 @@ class Check(object):
return
self
.
check_target_unit_with_flag
(
sources
,
targets
,
unit
)
# Is this disabled by default
if
self
.
default_disabled
and
self
.
enable_string
not
in
unit
.
all_flags
:
return
False
# Is this check ignored
if
self
.
ignore_string
in
unit
.
all_flags
:
if
self
.
should_skip
(
unit
):
return
False
# No checking of not translated units
if
self
.
ignore_untranslated
and
not
unit
.
translated
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment