Skip to content

Commit

Permalink
v0.3.0
Browse files Browse the repository at this point in the history
- feat: added lowercase attribute rewrite function
- fix: setup github weblink
  • Loading branch information
peppelinux committed Jun 17, 2021
1 parent 23335ef commit e90bcfb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 69 deletions.
67 changes: 0 additions & 67 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

22 changes: 22 additions & 0 deletions multildap/attr_rewrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,28 @@ def regexp_replace(attrs, regexp='', sub='', encoding='utf-8'):
return d


def lowercase(attrs, fields=[], encoding='utf-8'):
"""
fields -> limits only to specified attributes
rewrite_rules =
[
{'package': 'multildap.attr_rewrite',
'name': 'lowercase',
'kwargs': {'fields': ['email', 'mail']}
},
...
"""
d = attrs.copy()
for k,v in attrs.items():
if k in fields:
items = decode_iterables(v, encoding)
d[k] = [e.lower() for e in items]
return d


def replace(attrs, from_str='', to_str='', to_attrs=[], encoding='utf-8'):
"""
to_attrs -> limits only to specified attributes
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def readme():
return f.read()

setup(name=_name,
version='0.2',
version='0.3.0',
zip_safe = False,
description="LDAP client or proxy to multiple LDAP server",
long_description=readme(),
Expand All @@ -16,7 +16,7 @@ def readme():
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3'],
url='https://github.com/peppelinux/{}'.format(_name),
url='https://github.com/peppelinux/pyMultiLDAP',
author='Giuseppe De Marco',
author_email='giuseppe.demarco@unical.it',
license='BSD',
Expand Down

0 comments on commit e90bcfb

Please sign in to comment.