Merge ~bdrung/ddeb-retriever/+git/main:pylint into ddeb-retriever:main
Status: | Needs review |
---|---|
Proposed branch: | ~bdrung/ddeb-retriever/+git/main:pylint |
Merge into: | ddeb-retriever:main |
Diff against target: |
204 lines (+32/-34) 3 files modified
archive_tools.py (+17/-17) ddeb_retriever.py (+5/-6) lpinfo.py (+10/-11) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Steve Langasek | Pending | ||
Review via email: mp+437384@code.launchpad.net |
Description of the change
This merge request contains some fixes/improvement for things that pylint or other linters complain about.
1. fix: Iterate over apt_pkg.TagFile
pylint complains about E1136: Value 'parser.section' is unsubscriptable
(unsubscriptabl
over `apt_pkg.
So iterate over `apt_pkg.TagFile` for the sections instead of calling
`step()` and accessing the `section` property.
This change was tested to also work on Ubuntu 16.04 "xenial" with
Python 3.5.2 and python3-apt 1.1.0~beta1ubun
2. Use `functools.cache` for `_get_lp()` to avoid using a global variable
and make the code more readable.
3. refactor: Mark unused variables as such
4. fix: Use lazy % formatting in logging functions
5. Use `timestamp()` method of datetime instead of calculating it manually.