Skip to content

Commit e90bcfb

Browse files
committed
v0.3.0
- feat: added lowercase attribute rewrite function - fix: setup github weblink
1 parent 23335ef commit e90bcfb

File tree

3 files changed

+24
-69
lines changed

3 files changed

+24
-69
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 0 additions & 67 deletions
This file was deleted.

multildap/attr_rewrite.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,28 @@ def regexp_replace(attrs, regexp='', sub='', encoding='utf-8'):
1414
return d
1515

1616

17+
def lowercase(attrs, fields=[], encoding='utf-8'):
18+
"""
19+
fields -> limits only to specified attributes
20+
21+
rewrite_rules =
22+
[
23+
24+
{'package': 'multildap.attr_rewrite',
25+
'name': 'lowercase',
26+
'kwargs': {'fields': ['email', 'mail']}
27+
},
28+
29+
...
30+
"""
31+
d = attrs.copy()
32+
for k,v in attrs.items():
33+
if k in fields:
34+
items = decode_iterables(v, encoding)
35+
d[k] = [e.lower() for e in items]
36+
return d
37+
38+
1739
def replace(attrs, from_str='', to_str='', to_attrs=[], encoding='utf-8'):
1840
"""
1941
to_attrs -> limits only to specified attributes

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def readme():
77
return f.read()
88

99
setup(name=_name,
10-
version='0.2',
10+
version='0.3.0',
1111
zip_safe = False,
1212
description="LDAP client or proxy to multiple LDAP server",
1313
long_description=readme(),
@@ -16,7 +16,7 @@ def readme():
1616
'License :: OSI Approved :: BSD License',
1717
'Programming Language :: Python :: 2',
1818
'Programming Language :: Python :: 3'],
19-
url='https://github.com/peppelinux/{}'.format(_name),
19+
url='https://github.com/peppelinux/pyMultiLDAP',
2020
author='Giuseppe De Marco',
2121
author_email='[email protected]',
2222
license='BSD',

0 commit comments

Comments
 (0)