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
f8aa80c5
Commit
f8aa80c5
authored
Apr 20, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Catch also other (parse) errors while validaating
parent
b12c1e4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
weblate/trans/models.py
weblate/trans/models.py
+9
-4
No files found.
weblate/trans/models.py
View file @
f8aa80c5
...
...
@@ -446,14 +446,19 @@ class SubProject(models.Model):
langs
[
code
]
=
match
# Try parsing files
failures
=
[]
notrecognized
=
[]
errors
=
[]
for
match
in
matches
:
try
:
factory
.
getobject
(
os
.
path
.
join
(
self
.
get_path
(),
match
))
except
ValueError
:
failures
.
append
(
match
)
if
len
(
failures
)
>
0
:
raise
ValidationError
(
_
(
'Format of %d matched files could not be recognized.'
)
%
len
(
failures
))
notrecognized
.
append
(
match
)
except
Exception
,
e
:
errors
.
append
(
str
(
e
))
if
len
(
notrecognized
)
>
0
:
raise
ValidationError
(
_
(
'Format of %d matched files could not be recognized.'
)
%
len
(
notrecognized
))
if
len
(
errors
)
>
0
:
raise
ValidationError
(
_
(
'Failed to parse %d matched files!'
)
%
len
(
errors
))
def
save
(
self
,
*
args
,
**
kwargs
):
'''
...
...
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