/[smecontribs]/rpms/Pootle/contribs8/Pootle-1.2.1-findunit.patch
ViewVC logotype

Contents of /rpms/Pootle/contribs8/Pootle-1.2.1-findunit.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download)
Wed Feb 24 16:25:42 2010 UTC (14 years, 2 months ago) by slords
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
Rename module

1 Only in Pootle-toolkit-1.2/Pootle/: ChangeLog.pre-0.8
2 Only in Pootle-toolkit-1.2/Pootle/: createpootlepot
3 Only in Pootle-toolkit-1.2/Pootle/: CREDITS
4 Only in Pootle-toolkit-1.2/Pootle/: .cvsignore
5 diff -ru Pootle-1.2.1/Pootle/indexpage.py Pootle-toolkit-1.2/Pootle/indexpage.py
6 --- Pootle-1.2.1/Pootle/indexpage.py 2008-09-22 10:45:47.000000000 -0600
7 +++ Pootle-toolkit-1.2/Pootle/indexpage.py 2009-03-09 09:51:27.000000000 -0600
8 @@ -441,7 +441,7 @@
9 self.project.uploadfile(self.session, self.dirname, uploadfile.filename, uploadfile.contents, overwrite)
10 self.project.scanpofiles()
11 elif uploadfile.filename.endswith(".zip"):
12 - self.project.uploadarchive(self.session, self.dirname, uploadfile.contents)
13 + self.project.uploadarchive(self.session, self.dirname, uploadfile.contents, overwrite)
14 self.project.scanpofiles()
15 else:
16 raise ValueError(self.localize("Can only upload PO files and zips of PO files"))
17 Only in Pootle-1.2.1/Pootle/: LICENSE
18 Only in Pootle-toolkit-1.2/Pootle/po: terminology
19 diff -ru Pootle-1.2.1/Pootle/pootlefile.py Pootle-toolkit-1.2/Pootle/pootlefile.py
20 --- Pootle-1.2.1/Pootle/pootlefile.py 2008-12-02 07:09:32.000000000 -0700
21 +++ Pootle-toolkit-1.2/Pootle/pootlefile.py 2009-08-25 06:42:21.000000000 -0600
22 @@ -618,11 +618,9 @@
23 # We can't use the multistring, because it might contain more than two
24 # entries in a PO xliff file. Rather use the singular.
25 source = unicode(newpo.source)
26 - if source in self.sourceindex:
27 - oldpo = self.sourceindex[source]
28 - matches.append((oldpo, newpo))
29 - else:
30 - matches.append((None, newpo))
31 + oldpo = self.findunit(source)
32 + matches.append((oldpo, newpo))
33 +
34 # find items that have been removed
35 matcheditems = set(oldpo for oldpo, newpo in matches if oldpo)
36 for oldpo in self.units:
37 Only in Pootle-toolkit-1.2/Pootle/: profiling
38 diff -ru Pootle-1.2.1/Pootle/projects.py Pootle-toolkit-1.2/Pootle/projects.py
39 --- Pootle-1.2.1/Pootle/projects.py 2008-12-03 08:22:18.000000000 -0700
40 +++ Pootle-toolkit-1.2/Pootle/projects.py 2009-08-25 06:42:21.000000000 -0600
41 @@ -643,7 +643,7 @@
42 archive.close()
43 return archivecontents.getvalue()
44
45 - def uploadarchive(self, session, dirname, archivecontents):
46 + def uploadarchive(self, session, dirname, archivecontents, overwrite):
47 """uploads the files inside the archive"""
48
49 def unzip_external(archivecontents):
50 @@ -667,7 +667,7 @@
51 print "error adding %s: not a %s file" % (fname, os.extsep + self.fileext)
52 continue
53 fcontents = open(os.path.join(path, fname), 'rb').read()
54 - self.uploadfile(session, path[len(basedir)+1:], fname, fcontents)
55 + self.uploadfile(session, path[len(basedir)+1:], fname, fcontents, overwrite)
56 os.path.walk(tempdir, upload, tempdir)
57 return
58 finally:
59 @@ -687,7 +687,7 @@
60 subdirname, pofilename = os.path.dirname(filename), os.path.basename(filename)
61 try:
62 # TODO: use zipfile info to set the time and date of the file
63 - self.uploadfile(session, os.path.join(dirname, subdirname), pofilename, contents)
64 + self.uploadfile(session, os.path.join(dirname, subdirname), pofilename, contents, overwrite)
65 except ValueError, e:
66 print "error adding %s" % filename, e
67 continue
68 @@ -1363,7 +1363,7 @@
69 pofile.makeindex()
70 elif not hasattr(pofile, "sourceindex"):
71 pofile.makeindex()
72 - unit = pofile.sourceindex.get(message, None)
73 + unit = pofile.findunit(message)
74 if not unit or not unit.istranslated():
75 continue
76 tmsg = unit.target
77 @@ -1377,7 +1377,7 @@
78 try:
79 if pofile.pofreshen() or not hasattr(pofile, "sourceindex"):
80 pofile.makeindex()
81 - unit = pofile.sourceindex.get(message, None)
82 + unit = pofile.findunit(message)
83 if not unit or not unit.istranslated():
84 continue
85 tmsg = unit.target
86 @@ -1402,7 +1402,7 @@
87 nplural, pluralequation = pofile.getheaderplural()
88 if pluralequation:
89 pluralfn = gettext.c2py(pluralequation)
90 - unit = pofile.sourceindex.get(singular, None)
91 + unit = pofile.findunit(singular)
92 if not unit or not unit.istranslated():
93 continue
94 tmsg = unit.target.strings[pluralfn(n)]
95 diff -ru Pootle-1.2.1/Pootle/templates/login.html Pootle-toolkit-1.2/Pootle/templates/login.html
96 --- Pootle-1.2.1/Pootle/templates/login.html 2008-10-01 04:21:10.000000000 -0600
97 +++ Pootle-toolkit-1.2/Pootle/templates/login.html 2008-12-15 07:49:52.000000000 -0700
98 @@ -11,9 +11,18 @@
99 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
100 <link rel="stylesheet" type="text/css" href="${baseurl}pootle.css" />
101 <link rel="shortcut icon" href="${baseurl}favicon.ico" />
102 + <script src="${baseurl}js/jquery/jquery.js" type="text/javascript"></script>
103 <!--[if lt IE 7.]>
104 <script defer type="text/javascript" src="${baseurl}js/correctpng.js"></script>
105 <![endif]-->
106 + <script>
107 + $(document).ready(function () {
108 + // Set focus to login form
109 + if (document.loginform) {
110 + document.loginform.username.focus();
111 + }
112 + });
113 + </script>
114 </head>
115
116 <body bgcolor="#FFFFFF">
117 diff -ru Pootle-1.2.1/Pootle/translatepage.py Pootle-toolkit-1.2/Pootle/translatepage.py
118 --- Pootle-1.2.1/Pootle/translatepage.py 2008-09-30 01:55:22.000000000 -0600
119 +++ Pootle-toolkit-1.2/Pootle/translatepage.py 2009-06-05 13:07:01.000000000 -0600
120 @@ -576,6 +576,8 @@
121
122 def escapetext(self, text, fancyspaces=True, stripescapes=False):
123 """Replace special characters &, <, >, add and handle escapes if asked."""
124 + if not text:
125 + return u""
126 text = text.replace("&", "&amp;") # Must be done first!
127 text = text.replace("<", "&lt;").replace(">", "&gt;")
128
129 @@ -615,6 +617,8 @@
130 return text
131
132 def escapefortextarea(self, text):
133 + if not text:
134 + return u""
135 text = text.replace("&", "&amp;") # Must be done first!
136 text = text.replace("<", "&lt;").replace(">", "&gt;")
137 text = text.replace("\r\n", '\\r\\n')
138 @@ -745,6 +749,8 @@
139 diffs should be list of diff opcodes
140 issrc specifies whether to use the src or destination positions in reconstructing the text
141 this escapes the text on the fly to prevent confusion in escaping the highlighting"""
142 + if not text:
143 + return u""
144 if issrc:
145 diffstart = [(i1, 'start', tag) for (tag, i1, i2, j1, j2) in diffs if tag != 'equal']
146 diffstop = [(i2, 'stop', tag) for (tag, i1, i2, j1, j2) in diffs if tag != 'equal']

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed