Univention Bugzilla – Attachment 6100 Details for
Bug 34556
ucs_registerLDAPExtension: error: --messagecatalog can only be used after --udm_module
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
univention-lib-messagecatalog.patch
univention-lib-messagecatalog.patch (text/plain), 5.04 KB, created by
Arvid Requate
on 2014-09-08 13:27:03 CEST
(
hide
)
Description:
univention-lib-messagecatalog.patch
Filename:
MIME Type:
Creator:
Arvid Requate
Created:
2014-09-08 13:27:03 CEST
Size:
5.04 KB
patch
obsolete
>Index: python/ldap_extension.py >=================================================================== >--- python/ldap_extension.py (Revision 53425) >+++ python/ldap_extension.py (Arbeitskopie) >@@ -140,10 +140,10 @@ > common_udm_options.extend(["--set", "ucsversionend=%s" % (options.ucsversionend,),]) > > if self.udm_module_name == "settings/udm_module": >- for messagecatalog in options.messagecatalog: >- filename_parts = os.path.splitext(os.path.basename(messagecatalog)) >+ for udm_module_messagecatalog in options.udm_module_messagecatalog: >+ filename_parts = os.path.splitext(os.path.basename(udm_module_messagecatalog)) > language = filename_parts[0] >- with open(messagecatalog, 'r') as f: >+ with open(udm_module_messagecatalog, 'r') as f: > common_udm_options.extend(["--append", "messagecatalog=%s %s" % (language, base64.b64encode(f.read()),),]) > if options.umcregistration: > try: >@@ -157,6 +157,20 @@ > with open(icon, 'r') as f: > common_udm_options.extend(["--append", "icon=%s" % (base64.b64encode(f.read()),),]) > >+ if self.udm_module_name == "settings/udm_syntax": >+ for udm_syntax_messagecatalog in options.udm_syntax_messagecatalog: >+ filename_parts = os.path.splitext(os.path.basename(udm_syntax_messagecatalog)) >+ language = filename_parts[0] >+ with open(udm_syntax_messagecatalog, 'r') as f: >+ common_udm_options.extend(["--append", "messagecatalog=%s %s" % (language, base64.b64encode(f.read()),),]) >+ >+ if self.udm_module_name == "settings/udm_hook": >+ for udm_hook_messagecatalog in options.udm_hook_messagecatalog: >+ filename_parts = os.path.splitext(os.path.basename(udm_hook_messagecatalog)) >+ language = filename_parts[0] >+ with open(udm_hook_messagecatalog, 'r') as f: >+ common_udm_options.extend(["--append", "messagecatalog=%s %s" % (language, base64.b64encode(f.read()),),]) >+ > rc, self.object_dn, stdout = self.udm_find_object_dn() > if not self.object_dn: > >@@ -858,6 +872,26 @@ > check_udm_module_options(option, opt_str, value, parser) > parser.values.ensure_value(option.dest, []).append(value) > >+def check_udm_syntax_options(option, opt_str, value, parser): >+ if value.startswith('--'): >+ raise OptionValueError("%s requires an argument" % (opt_str,)) >+ if not parser.values.udm_syntax: >+ raise OptionValueError("%s can only be used after --udm_syntax" % (opt_str,)) >+ >+def option_callback_append_udm_syntax_options(option, opt_str, value, parser): >+ check_udm_syntax_options(option, opt_str, value, parser) >+ parser.values.ensure_value(option.dest, []).append(value) >+ >+def check_udm_hook_options(option, opt_str, value, parser): >+ if value.startswith('--'): >+ raise OptionValueError("%s requires an argument" % (opt_str,)) >+ if not parser.values.udm_hook: >+ raise OptionValueError("%s can only be used after --udm_hook" % (opt_str,)) >+ >+def option_callback_append_udm_hook_options(option, opt_str, value, parser): >+ check_udm_hook_options(option, opt_str, value, parser) >+ parser.values.ensure_value(option.dest, []).append(value) >+ > def ucs_registerLDAPExtension(): > functionname = inspect.stack()[0][3] > parser = OptionParser(prog=functionname, option_class=UCSOption) >@@ -895,10 +929,14 @@ > help="End activation with UCS version", metavar="<UCS Version>") > > udm_module_options = OptionGroup(parser, "UDM module specific options") >- udm_module_options.add_option("--messagecatalog", dest="messagecatalog", >+ udm_module_options.add_option("--messagecatalog", dest="udm_module_messagecatalog", > type="existing_filename", default=[], > action="callback", callback=option_callback_append_udm_module_options, > help="Gettext mo file", metavar="<GNU message catalog file>") >+ udm_module_options.add_option("--udm_module_messagecatalog", dest="udm_module_messagecatalog", >+ type="existing_filename", default=[], >+ action="callback", callback=option_callback_append_udm_module_options, >+ help="Gettext mo file", metavar="<GNU message catalog file>") > udm_module_options.add_option("--umcregistration", dest="umcregistration", > type="existing_filename", > action="callback", callback=option_callback_set_udm_module_options, >@@ -909,7 +947,20 @@ > help="UDM module icon", metavar="<Icon file>") > parser.add_option_group(udm_module_options) > >+ udm_module_options = OptionGroup(parser, "UDM syntax specific options") >+ udm_module_options.add_option("--udm_syntax_messagecatalog", dest="udm_syntax_messagecatalog", >+ type="existing_filename", default=[], >+ action="callback", callback=option_callback_append_udm_syntax_options, >+ help="Gettext mo file", metavar="<GNU message catalog file>") >+ parser.add_option_group(udm_module_options) > >+ udm_module_options = OptionGroup(parser, "UDM hook specific options") >+ udm_module_options.add_option("--udm_hook_messagecatalog", dest="udm_hook_messagecatalog", >+ type="existing_filename", default=[], >+ action="callback", callback=option_callback_append_udm_hook_options, >+ help="Gettext mo file", metavar="<GNU message catalog file>") >+ parser.add_option_group(udm_module_options) >+ > # parser.add_option("-v", "--verbose", action="count") > > udm_passthrough_options = []
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 34556
: 6100