Univention Bugzilla – Attachment 5237 Details for
Bug 31257
"ucr get" vs "ucr shell" performance
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Regular expression optimization
31257_ucr-regexp-opt.diff (text/plain), 1.18 KB, created by
Philipp Hahn
on 2013-05-24 11:25 CEST
(
hide
)
Description:
Regular expression optimization
Filename:
MIME Type:
Creator:
Philipp Hahn
Created:
2013-05-24 11:25 CEST
Size:
1.18 KB
patch
obsolete
>--- /home/phahn/GIT/branches/ucs-3.1/ucs-3.1-2/base/univention-config-registry/python/univention/config_registry/frontend.py 2013-04-25 07:34:22.557864398 +0200 >+++ /tmp/frontend.py 2013-05-24 11:20:20.921381541 +0200 >@@ -310,10 +310,10 @@ > search_keys |= search_all > > if not args: >- regex = [re.compile('')] >+ search = lambda x: True > else: > try: >- regex = [re.compile(_) for _ in args] >+ search = re.compile('|'.join(('(?:%s)' % (_,) for _ in args))).search > except re.error, ex: > print >> sys.stderr, 'E: invalid regular expression: %s' % (ex,) > sys.exit(1) >@@ -352,13 +352,11 @@ > all_vars[key] = (value, None, scope) > > for key, (value, vinfo, scope) in all_vars.items(): >- for reg in regex: >- if ((search_keys and reg.search(key)) or >- (search_values and value and reg.search(value)) or >+ if ((search_keys and search(key)) or >+ (search_values and value and search(value)) or > (search_all and vinfo and >- reg.search(vinfo.get('description', '')))): >+ search(vinfo.get('description', '')))): > print_variable_info_string(key, value, vinfo, details=details) >- break > > if _SHOW_EMPTY & details and not OPT_FILTERS['shell'][2]: > patterns = {}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 31257
: 5237