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
ceb1cd34
Commit
ceb1cd34
authored
Mar 27, 2014
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PEP-8 for not in conditions
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
e41ed56e
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
15 additions
and
15 deletions
+15
-15
weblate/accounts/pipeline.py
weblate/accounts/pipeline.py
+1
-1
weblate/lang/models.py
weblate/lang/models.py
+1
-1
weblate/trans/checks/format.py
weblate/trans/checks/format.py
+1
-1
weblate/trans/checks/markup.py
weblate/trans/checks/markup.py
+1
-1
weblate/trans/formats.py
weblate/trans/formats.py
+2
-2
weblate/trans/forms.py
weblate/trans/forms.py
+1
-1
weblate/trans/machine/glosbe.py
weblate/trans/machine/glosbe.py
+1
-1
weblate/trans/management/commands/import_project.py
weblate/trans/management/commands/import_project.py
+1
-1
weblate/trans/models/subproject.py
weblate/trans/models/subproject.py
+1
-1
weblate/trans/models/unit.py
weblate/trans/models/unit.py
+2
-2
weblate/trans/validators.py
weblate/trans/validators.py
+1
-1
weblate/trans/views/dictionary.py
weblate/trans/views/dictionary.py
+1
-1
weblate/trans/views/js.py
weblate/trans/views/js.py
+1
-1
No files found.
weblate/accounts/pipeline.py
View file @
ceb1cd34
...
...
@@ -111,7 +111,7 @@ def user_full_name(strategy, details, user=None, **kwargs):
first_name
=
details
.
get
(
'first_name'
,
''
)
last_name
=
details
.
get
(
'last_name'
,
''
)
if
first_name
and
not
first_name
in
last_name
:
if
first_name
and
first_name
not
in
last_name
:
full_name
=
u'{0} {1}'
.
format
(
first_name
,
last_name
)
elif
first_name
:
full_name
=
first_name
...
...
weblate/lang/models.py
View file @
ceb1cd34
...
...
@@ -387,7 +387,7 @@ class Language(models.Model, PercentMixin):
self
.
_percents
=
None
def
__unicode__
(
self
):
if
(
not
'('
in
self
.
name
if
(
'('
not
in
self
.
name
and
(
'_'
in
self
.
code
or
'-'
in
self
.
code
)
and
self
.
code
not
in
(
'zh_TW'
,
'zh_CN'
)):
return
'%s (%s)'
%
(
_
(
self
.
name
),
self
.
code
)
...
...
weblate/trans/checks/format.py
View file @
ceb1cd34
...
...
@@ -111,7 +111,7 @@ class BaseFormatCheck(TargetCheck):
Checks single unit, handling plurals.
'''
# Verify unit is properly flagged
if
not
self
.
flag
in
unit
.
all_flags
:
if
self
.
flag
not
in
unit
.
all_flags
:
return
False
# Special case languages with single plural form
...
...
weblate/trans/checks/markup.py
View file @
ceb1cd34
...
...
@@ -94,7 +94,7 @@ class XMLTagsCheck(TargetCheck):
# Do we need to process source (cache miss)
if
source_tags
is
None
:
# Quick check if source looks like XML
if
not
'<'
in
source
or
len
(
XML_MATCH
.
findall
(
source
))
==
0
:
if
'<'
not
in
source
or
len
(
XML_MATCH
.
findall
(
source
))
==
0
:
self
.
set_cache
(
unit
,
[],
cache_slot
)
return
False
# Check if source is XML
...
...
weblate/trans/formats.py
View file @
ceb1cd34
...
...
@@ -386,7 +386,7 @@ class FileFormat(object):
'''
return
(
(
self
.
monolingual
or
self
.
monolingual
is
None
)
and
not
self
.
template_store
is
None
and
self
.
template_store
is
not
None
)
def
find_unit
(
self
,
context
,
source
):
...
...
@@ -452,7 +452,7 @@ class FileFormat(object):
# Adjust Content-Type header if needed
header
=
self
.
store
.
parseheader
()
if
(
not
'Content-Type'
in
header
if
(
'Content-Type'
not
in
header
or
'charset=CHARSET'
in
header
[
'Content-Type'
]
or
'charset=ASCII'
in
header
[
'Content-Type'
]):
kwargs
[
'Content_Type'
]
=
'text/plain; charset=UTF-8'
...
...
weblate/trans/forms.py
View file @
ceb1cd34
...
...
@@ -115,7 +115,7 @@ class PluralTextarea(forms.Textarea):
ret
=
[
data
.
get
(
name
,
None
)]
for
idx
in
range
(
1
,
10
):
fieldname
=
'%s_%d'
%
(
name
,
idx
)
if
not
fieldname
in
data
:
if
fieldname
not
in
data
:
break
ret
.
append
(
data
.
get
(
fieldname
,
None
))
ret
=
[
smart_unicode
(
r
.
replace
(
'
\
r
'
,
''
))
for
r
in
ret
]
...
...
weblate/trans/machine/glosbe.py
View file @
ceb1cd34
...
...
@@ -55,7 +55,7 @@ class GlosbeTranslation(MachineTranslation):
**
params
)
if
not
'tuc'
in
response
:
if
'tuc'
not
in
response
:
return
[]
return
[(
match
[
'phrase'
][
'text'
],
100
,
self
.
name
,
text
)
...
...
weblate/trans/management/commands/import_project.py
View file @
ceb1cd34
...
...
@@ -149,7 +149,7 @@ class Command(BaseCommand):
)
# Do we have correct mask?
if
not
'**'
in
filemask
:
if
'**'
not
in
filemask
:
raise
CommandError
(
'You need to specify double wildcard '
'for subproject part of the match!'
...
...
weblate/trans/models/subproject.py
View file @
ceb1cd34
...
...
@@ -526,7 +526,7 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
return
self
.
linked_subproject
.
configure_branch
()
# create branch if it does not exist
if
not
self
.
branch
in
self
.
git_repo
.
heads
:
if
self
.
branch
not
in
self
.
git_repo
.
heads
:
self
.
git_repo
.
git
.
branch
(
'--track'
,
self
.
branch
,
...
...
weblate/trans/models/unit.py
View file @
ceb1cd34
...
...
@@ -107,7 +107,7 @@ class UnitManager(models.Manager):
checks
=
checks
.
filter
(
language
=
translation
.
language
)
# Filter by check type
if
not
rqtype
in
[
'allchecks'
,
'sourcechecks'
]
:
if
rqtype
not
in
(
'allchecks'
,
'sourcechecks'
)
:
checks
=
checks
.
filter
(
check
=
rqtype
)
checks
=
checks
.
values_list
(
'contentsum'
,
flat
=
True
)
...
...
@@ -644,7 +644,7 @@ class Unit(models.Model):
git backend (eg. commit or by parsing file).
'''
# Warn if request is not coming from backend
if
not
'backend'
in
kwargs
:
if
'backend'
not
in
kwargs
:
weblate
.
logger
.
error
(
'Unit.save called without backend sync: %s'
,
''
.
join
(
traceback
.
format_stack
())
...
...
weblate/trans/validators.py
View file @
ceb1cd34
...
...
@@ -75,7 +75,7 @@ def validate_filemask(val):
'''
Validates file mask that it contains *.
'''
if
not
'*'
in
val
:
if
'*'
not
in
val
:
raise
ValidationError
(
_
(
'File mask does not contain * as a language placeholder!'
)
)
...
...
weblate/trans/views/dictionary.py
View file @
ceb1cd34
...
...
@@ -241,7 +241,7 @@ def download_dictionary(request, project, lang):
export_format
=
None
if
'format'
in
request
.
GET
:
export_format
=
request
.
GET
[
'format'
]
if
not
export_format
in
[
'csv'
,
'po'
,
'tbx'
]
:
if
export_format
not
in
(
'csv'
,
'po'
,
'tbx'
)
:
export_format
=
'csv'
# Grab all words
...
...
weblate/trans/views/js.py
View file @
ceb1cd34
...
...
@@ -58,7 +58,7 @@ def translate(request, unit_id):
service_name
=
request
.
GET
.
get
(
'service'
,
'INVALID'
)
if
not
service_name
in
MACHINE_TRANSLATION_SERVICES
:
if
service_name
not
in
MACHINE_TRANSLATION_SERVICES
:
return
HttpResponseBadRequest
(
'Invalid service specified'
)
translation_service
=
MACHINE_TRANSLATION_SERVICES
[
service_name
]
...
...
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