grepedit/notifyd.py: Convert to Python 3
Run the following commands:
% 2to3-2.7 -w usr_bin/grepedit
% isort usr_bin/grepedit
% black usr_bin/grepedit
In grepedit the following print statement has been split manually:
+ print(
+ "%s:%s has changed since the grep command ran- "
+ "not modifying this line" % key
+ )
And:
% 2to3-2.7 -w usr_bin/notifyd.py
% black usr_bin/notifyd.py
% isort usr_bin/notifyd.py
In notifyd.py added some ignore statements/comments (for the examples
which were actually comments).
The following errors/warnings were fixed manually:
❯ flake8 --max-line-length 88 usr_bin/notifyd.py
usr_bin/notifyd.py:201:1: E741 ambiguous variable name 'l'
usr_bin/notifyd.py:214:5: E722 do not use bare 'except'
Variable 'l' has been renamed to 'listen' and the bare 'except' has been
changed to catch 'OSError' as described in the socket documentation:
https://docs.python.org/3/library/socket.html
grepedit + notifyd.py + osd_server.py has not been functionally tested.
Please test. (But this is not the scope of this change, as it had to be
dropped anyway as it is missing Python 3 support. If an errors occurs,
please file a bug report.)
black defaults to line length 88 and flake to 79.
Decided to go set --max-line-length 88 for flake8.
Note that osd_server.py is just a symlink to notifyd.py.