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
bca385d0
Commit
bca385d0
authored
Oct 30, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not edit obsolete units
parent
100952e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
trans/formats.py
trans/formats.py
+8
-0
No files found.
trans/formats.py
View file @
bca385d0
...
@@ -385,8 +385,12 @@ class FileFormat(object):
...
@@ -385,8 +385,12 @@ class FileFormat(object):
raise
Exception
(
raise
Exception
(
'Could not find template unit for new unit!'
'Could not find template unit for new unit!'
)
)
if
template_ttkit_unit
.
isobsolete
():
return
(
None
,
False
)
add
=
True
add
=
True
else
:
else
:
if
ttkit_unit
.
isobsolete
():
return
(
None
,
False
)
add
=
False
add
=
False
return
(
FileUnit
(
ttkit_unit
,
template_ttkit_unit
),
add
)
return
(
FileUnit
(
ttkit_unit
,
template_ttkit_unit
),
add
)
...
@@ -396,6 +400,8 @@ class FileFormat(object):
...
@@ -396,6 +400,8 @@ class FileFormat(object):
# Find is broken for propfile, ignore results
# Find is broken for propfile, ignore results
if
len
(
found_units
)
>
0
and
not
isinstance
(
self
.
store
,
propfile
):
if
len
(
found_units
)
>
0
and
not
isinstance
(
self
.
store
,
propfile
):
for
ttkit_unit
in
found_units
:
for
ttkit_unit
in
found_units
:
if
ttkit_unit
.
isobsolete
():
continue
# Does context match?
# Does context match?
if
ttkit_unit
.
getcontext
()
==
context
:
if
ttkit_unit
.
getcontext
()
==
context
:
return
(
FileUnit
(
ttkit_unit
),
False
)
return
(
FileUnit
(
ttkit_unit
),
False
)
...
@@ -403,6 +409,8 @@ class FileFormat(object):
...
@@ -403,6 +409,8 @@ class FileFormat(object):
# Fallback to manual find for value based files
# Fallback to manual find for value based files
for
ttkit_unit
in
self
.
store
.
units
:
for
ttkit_unit
in
self
.
store
.
units
:
ttkit_unit
=
FileUnit
(
ttkit_unit
)
ttkit_unit
=
FileUnit
(
ttkit_unit
)
if
ttkit_unit
.
isobsolete
():
continue
if
ttkit_unit
.
get_source
()
==
source
:
if
ttkit_unit
.
get_source
()
==
source
:
return
(
ttkit_unit
,
False
)
return
(
ttkit_unit
,
False
)
...
...
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