Closed Bug 466929 Opened 16 years ago Closed 16 years ago

[silme] add has_entity() to diff/l10nobject.py and diff/entitylist.py

Categories

(Mozilla Localizations :: Infrastructure, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: adriank, Assigned: adriank)

References

Details

Attachments

(2 files, 1 obsolete file)

From an IRC discussion with Gandalf: would be nice to have that methods. L10nObjectDiff.hasEnity() is implemented in the same way like L10nObjectDiff.getEnity(), which is really slowing down Silme, if used. But if someone will need to have that...
Attachment #350255 - Flags: review?(gandalf)
Attachment #350256 - Flags: review?(gandalf)
Comment on attachment 350256 [details] [diff] [review] add hasEntity() to L10nObjectDiff nope, it's part of the lib, we have to have a full featured code for iterating through elements and seeking for entity.
Attachment #350256 - Flags: review?(gandalf) → review-
Comment on attachment 350255 [details] [diff] [review] add hasEntity() to EntityListDiff One liner is better here def hasEntity(self, id): return self.has_key(id)
Attachment #350255 - Flags: review?(gandalf) → review-
changed according to review in comment #3
Attachment #350255 - Attachment is obsolete: true
Attachment #350924 - Flags: review?(gandalf)
I'd like to take this for 0.5.1
Blocks: 494517
Comment on attachment 350924 [details] [diff] [review] (v2) add hasEntity() to EntityListDiff the patch needs an update, but r+ of course :)
Attachment #350924 - Flags: review?(gandalf) → review+
At least EntityListDiff.has_entity, not sure about L10nObjectDiff
Summary: [silme] add hasEntity() to diff/l10nobject.py and diff/entitylist.py → [silme] add has_entity() to diff/l10nobject.py and diff/entitylist.py
Gandalf: L10nObjectDiff.has_entity() will need (nearly) the same code like for get_entity(): "L10nObjectDiff.get_entity() should be less time consuming (better not to do get_entitylistdiff which does get_entities to get one single entity...)" for Silme 0.7 ( https://wiki.mozilla.org/Silme:0.7 ) Nominating for 0.7.
Blocks: 495229
Fixed: http://hg.mozilla.org/users/zbraniecki_mozilla.com/silme/rev/fe0675299497 The performance is a material for a separate bug. I improved it by 30%, and I expect we can get another 30% but it'll still be pretty slow (bare in mind we have to find both, added and removed to mark it as "modified" in get_entity. In has_entity we can skip it)
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: