This is an automatically generated e-mail. To reply, visit: http://reviewboard-fedoraserver.rhcloud.com/r/196/

On August 26th, 2015, 2:09 p.m. UTC, Stephen Gallagher wrote:

src/rolekit/server/io/rolesettings.py (Diff revision 1)
68
        if "changed" in self._callbacks and self._callbacks["changed"]:
69
            cb = self._callbacks["changed"]

Similarly, isn't it more pythonic for this to be:

try:
    cb = self._callbacks["changed"]
except KeyError:
    # Log the lack of a changed callback
    return
cb_args = [ key, value ]
...

This will never fail, because self._callbacks = { "changed": None } is set in init. cb will be None if no handler is set.


- Thomas


On August 26th, 2015, 1:21 p.m. UTC, Thomas Woerner wrote:

Review request for RoleKit Mailing List, Miloslav Trmac, Nils Philippsen, Stephen Gallagher, and Thomas Woerner.
By Thomas Woerner.

Updated Aug. 26, 2015, 1:21 p.m.

Repository: rolekit

Description

Only the changed signal is supported right now. As soon as a settings is
modified, the connected handler will be called for this setting.

Diffs

  • src/rolekit/server/io/rolesettings.py (18f4871faf87ba23d21a3f9bc2c13b14463a8ccf)

View Diff