summaryrefslogtreecommitdiffstats
path: root/python/netlink/util.py
Commit message (Collapse)AuthorAgeFilesLines
* python: fix flake8 warnings E302Thomas Haller2023-07-251-0/+1
| | | | ./python/netlink/util.py:19:1: E302 expected 2 blank lines, found 1
* python: fix flake8 warnings F401Thomas Haller2023-07-251-2/+0
| | | | | | | | | ./doc/doxygen-link.py:4:1: F401 'fileinput' imported but unused ./doc/resolve-asciidoc-refs.py:5:1: F401 'fileinput' imported but unused ./python/doc/conf.py:14:1: F401 'sys' imported but unused ./python/doc/conf.py:14:1: F401 'os' imported but unused ./python/netlink/util.py:13:1: F401 '.core as netlink' imported but unused ./python/netlink/util.py:16:1: F401 'types' imported but unused
* python: reformat all Python files with python-blackThomas Haller2023-07-251-21/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Automated code formatting is great. Use python-black for that ([1]). Black us not configurable much (uncompromising) and follows PEP8. It thus generates quite a standard, pleasing format. But the point isn't whether the formatting is always the most subjectively pleasing. The point is that the style is generated and enforceable by an automated tool. It takes away places for nit picking, while resulting in a more consistent code base. As this reformats the entire code base, it introduces a large diff and interferes with tools like git-blame. That will be somewhat alleviated by adding a "blame.ignoreRevsFile" for git in the next commit. The change is done automatically, by running python-black version black-22.8.0-2.fc38.noarch: $ black . The result is the same as $ ( git grep -l '#!.*\(PYTHON\|python\)' ; git ls-files '*.py' '*.py.in' ) \ | sort -u \ | xargs -d '\n' black Note that the exact result depends on the version of black. Currently that version is black==22.12.0 from pip. Yes, this means when we bump the version in the future, some reformatting will happen. [1] https://github.com/psf/black
* Fixed ObjIterator for python3, fixed output of _color and added missing ↵Teto2013-10-071-1/+2
| | | | | | | | | | | | | | | | | | | | parameter to nl_cache_resync Here are a few things I fixed and that provoked a python error. I canno't answer to this thread but one solution I found while using the python binding is to iterate over all and filter via python http://list-archives.org/2013/09/09/libnl-lists-infradead-org/missing-feature-for-retrieving-cached- address-objects/f/5031600704 Example: cache = nlrta.AddressCache() cache.resync() for i in cache: print ("item", i ) # then you can filter here Signed-off-by: Thomas Graf <tgraf@suug.ch>
* netlink.nlattr re-implemented in more pythonic wayКоренберг Марк2012-06-081-14/+9
|
* pylint's first review and trivial fixesКоренберг Марк (ноутбук дома)2012-06-081-8/+8
|
* Using only single quotes now and multi-line listsКоренберг Марк (ноутбук дома)2012-06-081-2/+2
| | | | Nothing algorithmic changed really, just cosmetics
* Fix indentation (spaces vs tabs)Коренберг Марк (ноутбук дома)2012-06-081-108/+108
| | | | Now, python files use pseudo-tab equal 4 spaces
* Code cleanupsКоренберг Марк (ноутбук дома)2012-06-081-4/+2
| | | | | | 1. unused "import struct" removed 2. AddressFamily.__len__ is defined, but why in so way? removed. 3. comparison against instancemethod type fixed
* Fixed various str-related logickКоренберг Марк (ноутбук дома)2012-06-081-2/+2
|
* Fix whitespaces at EOLКоренберг Марк (ноутбук дома)2012-06-081-2/+2
| | | | Make git happy with that
* Introduce Python's absolute_importsКоренберг Марк (ноутбук дома)2012-06-081-2/+4
| | | | Helps greatly when porting to Python 3
* Fix typo in still unused function that generate colored messageКоренберг Марк (ноутбук дома)2012-06-081-1/+1
|
* Work on libnl-pythonThomas Graf2011-06-101-0/+33
| | | | Changes too numerous to describe them
* python interface to netlink protocolsThomas Graf2011-05-101-0/+146
currently includes experimental support for links, addresses and some traffic control