Univention Bugzilla – Attachment 7343 Details for
Bug 40167
dh-umc-module-build created invalid .po files with duplicate entries
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Don't create duplicate entries
file_40167.txt (text/plain), 1.48 KB, created by
Philipp Hahn
on 2015-12-03 14:58:11 CET
(
hide
)
Description:
Don't create duplicate entries
Filename:
MIME Type:
Creator:
Philipp Hahn
Created:
2015-12-03 14:58:11 CET
Size:
1.48 KB
patch
obsolete
>diff --git a/branches/ucs-4.1/ucs-4.1-0/management/univention-management-console/dev/dh_umc.py b/branches/ucs-4.1/ucs-4.1-0/management/univention-management-console/dev/dh_umc.py >index bf182aa..259eb6d 100644 >--- a/branches/ucs-4.1/ucs-4.1-0/management/univention-management-console/dev/dh_umc.py >+++ b/branches/ucs-4.1/ucs-4.1-0/management/univention-management-console/dev/dh_umc.py >@@ -221,15 +221,22 @@ def read_modules(package, core=False): > def _appendPoEntry(poFile, xmlEntry): > """Helper function to access text property of XML elements and to find the > corresponding po-entry.""" >- if xmlEntry is not None and xmlEntry.text is not None: # important to use "xmlEntry is non None"! >- poFile.append(polib.POEntry(msgid=xmlEntry.text, msgstr='')) >+ if xmlEntry is None: >+ return >+ text = xmlEntry.text >+ if text is None: >+ return >+ try: >+ poFile.append(polib.POEntry(msgid=text, msgstr='')) >+ except ValueError: >+ print "I: duplicate entry: %s" % (text,) > > > def module_xml2po(module, po_file, language): > """Create a PO file the XML definition of an UMC module""" > message_po = '%s/messages.po' % (os.path.dirname(po_file) or '.') > >- po = polib.POFile() >+ po = polib.POFile(check_for_duplicates=True) > po.header = PO_HEADER > po.metadata = copy.copy(PO_METADATA) > po.metadata['Project-Id-Version'] = module.package
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 40167
: 7343