rpms/translate-toolkit/F-12 translate-toolkit-1.4.1-r12685-backport-index-speedup.patch, NONE, 1.1 translate-toolkit-1.4.1-r12686-backport-id-index.patch, NONE, 1.1 translate-toolkit-1.4.1-r12724-backport-hassuggestion-speedup.patch, NONE, 1.1 translate-toolkit-1.4.1-r12727-backport-msgidcomment.patch, NONE, 1.1 translate-toolkit.spec, 1.37, 1.38
dwayne
dwayne at fedoraproject.org
Fri Nov 6 19:51:19 UTC 2009
Author: dwayne
Update of /cvs/pkgs/rpms/translate-toolkit/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv16932
Modified Files:
translate-toolkit.spec
Added Files:
translate-toolkit-1.4.1-r12685-backport-index-speedup.patch
translate-toolkit-1.4.1-r12686-backport-id-index.patch
translate-toolkit-1.4.1-r12724-backport-hassuggestion-speedup.patch
translate-toolkit-1.4.1-r12727-backport-msgidcomment.patch
Log Message:
* Fri Nov 6 2009 Dwayne Bailey <dwayne at translate.org.za> - 1.4.1-3
- Backport various fixes needed for Pootle 1.3
- r12685 index speedup
- r12686 id index
- r12724 hassuggestion speedup
- r12727 msgidcomment
translate-toolkit-1.4.1-r12685-backport-index-speedup.patch:
base.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- NEW FILE translate-toolkit-1.4.1-r12685-backport-index-speedup.patch ---
Index: translate/storage/base.py
===================================================================
--- translate/storage/base.py (revision 12684)
+++ translate/storage/base.py (revision 12685)
@@ -537,7 +537,8 @@
self.sourceindex = {}
for unit in self.units:
# Do we need to test if unit.source exists?
- self.add_unit_to_index(unit)
+ if unit.istranslatable():
+ self.add_unit_to_index(unit)
def require_index(self):
"""make sure source index exists"""
translate-toolkit-1.4.1-r12686-backport-id-index.patch:
base.py | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
--- NEW FILE translate-toolkit-1.4.1-r12686-backport-id-index.patch ---
Index: translate/storage/base.py
===================================================================
--- translate/storage/base.py (revision 12685)
+++ translate/storage/base.py (revision 12686)
@@ -442,9 +442,14 @@
self.addunit(unit)
return unit
+ def findid(self, id):
+ """find unit with matching id by checking id_index"""
+ self.require_index()
+ return self.id_index.get(id, None)
+
def findunit(self, source):
"""Finds the unit with the given source string.
-
+
@rtype: L{TranslationUnit} or None
"""
if len(getattr(self, "sourceindex", [])):
@@ -511,6 +516,8 @@
def add_unit_to_index(self, unit):
"""Add a unit to source and location idexes"""
+ self.id_index[unit.getid()] = unit
+
def insert_unit(source):
if not source in self.sourceindex:
self.sourceindex[source] = [unit]
@@ -535,6 +542,7 @@
"""Indexes the items in this store. At least .sourceindex should be usefull."""
self.locationindex = {}
self.sourceindex = {}
+ self.id_index = {}
for unit in self.units:
# Do we need to test if unit.source exists?
if unit.istranslatable():
@@ -545,7 +553,7 @@
if not hasattr(self, "sourceindex"):
self.makeindex()
-
+
def __getstate__(self):
odict = self.__dict__.copy()
odict['fileobj'] = None
translate-toolkit-1.4.1-r12724-backport-hassuggestion-speedup.patch:
checks.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- NEW FILE translate-toolkit-1.4.1-r12724-backport-hassuggestion-speedup.patch ---
Index: translate/filters/checks.py
===================================================================
--- translate/filters/checks.py (revision 12723)
+++ translate/filters/checks.py (revision 12724)
@@ -280,6 +280,8 @@
def setsuggestionstore(self, store):
"""Sets the filename that a checker should use for evaluating suggestions."""
self.suggestion_store = store
+ if self.suggestion_store:
+ self.suggestion_store.require_index()
def filtervariables(self, str1):
"""filter out variables from str1"""
@@ -1178,8 +1180,7 @@
self.suggestion_store = getattr(self, 'suggestion_store', None)
suggestions = []
if self.suggestion_store:
- source = unit.source
- suggestions = [unit for unit in self.suggestion_store.units if unit.source == source]
+ suggestions = self.suggestion_store.findunits(unit.source)
elif xliff and isinstance(unit, xliff.xliffunit):
# TODO: we probably want to filter them somehow
suggestions = unit.getalttrans()
translate-toolkit-1.4.1-r12727-backport-msgidcomment.patch:
pypo.py | 8 ++++++++
1 file changed, 8 insertions(+)
--- NEW FILE translate-toolkit-1.4.1-r12727-backport-msgidcomment.patch ---
Index: translate/storage/pypo.py
===================================================================
--- translate/storage/pypo.py (revision 12726)
+++ translate/storage/pypo.py (revision 12727)
@@ -663,6 +663,14 @@
text = unquotefrompo(self.msgidcomments)
return text.split('\n')[0].replace('_: ', '', 1)
+ def setmsgidcomment(self, msgidcomment):
+ if msgidcomment:
+ self.msgidcomments = ['"_: %s\\n"' % msgidcomment]
+ else:
+ self.msgidcomments = []
+
+ msgidcomment = property(_extract_msgidcomments, setmsgidcomment)
+
def getcontext(self):
"""Get the message context."""
return unquotefrompo(self.msgctxt) + self._extract_msgidcomments()
Index: translate-toolkit.spec
===================================================================
RCS file: /cvs/pkgs/rpms/translate-toolkit/F-12/translate-toolkit.spec,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -p -r1.37 -r1.38
--- translate-toolkit.spec 15 Oct 2009 15:16:04 -0000 1.37
+++ translate-toolkit.spec 6 Nov 2009 19:51:19 -0000 1.38
@@ -2,7 +2,7 @@
Name: translate-toolkit
Version: 1.4.1
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: Tools to assist with translation and software localization
Group: Development/Tools
@@ -12,6 +12,10 @@ Source0: http://downloads.sourcef
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Patch0: translate-toolkit-1.2.1-stoplist.patch
+Patch1: translate-toolkit-1.4.1-r12685-backport-index-speedup.patch
+Patch2: translate-toolkit-1.4.1-r12686-backport-id-index.patch
+Patch3: translate-toolkit-1.4.1-r12724-backport-hassuggestion-speedup.patch
+Patch4: translate-toolkit-1.4.1-r12727-backport-msgidcomment.patch
BuildArch: noarch
BuildRequires: python-devel
@@ -68,6 +72,10 @@ toolkit or to use the libraries in other
%prep
%setup -q
%patch0 -p1
+%patch1 -p0
+%patch2 -p0
+%patch3 -p0
+%patch4 -p0
%build
@@ -122,6 +130,13 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Fri Nov 6 2009 Dwayne Bailey <dwayne at translate.org.za> - 1.4.1-3
+- Backport various fixes needed for Pootle 1.3
+ - r12685 index speedup
+ - r12686 id index
+ - r12724 hassuggestion speedup
+ - r12727 msgidcomment
+
* Thu Oct 15 2009 Dwayne Bailey <dwayne at translate.org.za> - 1.4.1-2
- Retag
More information about the fedora-extras-commits
mailing list