10 Commits

Author SHA1 Message Date
Stephen Finucane
2a6420a3ed Add ruff
Change-Id: I2518e0cf928210acf9cfb2e5f4c19f973df64485
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2026-03-12 19:39:58 +00:00
Takashi Kajinami
80e1aadc49 Run pyupgrade to clean up Python 2 syntaxes
Update all .py source files by
 $ pyupgrade --py3-only $(git ls-files | grep ".py$")
to modernize the code according to Python 3 syntaxes.

pep8 errors are fixed by
 $ autopep8 --select=E127,E128,E501 --max-line-length 79 -r \
    --in-place taskflow

Also add the pyupgrade hook to pre-commit to avoid merging additional
Python 2 syntaxes.

Change-Id: Ifd0a0ade9789497482c7937bffd82c48acfb3d78
2025-04-02 15:23:12 +09:00
Hervé Beraud
1877565d4d Stop to use the __future__ module.
The __future__ module [1] was used in this context to ensure compatibility
between python 2 and python 3.

We previously dropped the support of python 2.7 [2] and now we only support
python 3 so we don't need to continue to use this module and the imports
listed below.

Imports commonly used and their related PEPs:
- `division` is related to PEP 238 [3]
- `print_function` is related to PEP 3105 [4]
- `unicode_literals` is related to PEP 3112 [5]
- `with_statement` is related to PEP 343 [6]
- `absolute_import` is related to PEP 328 [7]

[1] https://docs.python.org/3/library/__future__.html
[2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html
[3] https://www.python.org/dev/peps/pep-0238
[4] https://www.python.org/dev/peps/pep-3105
[5] https://www.python.org/dev/peps/pep-3112
[6] https://www.python.org/dev/peps/pep-0343
[7] https://www.python.org/dev/peps/pep-0328

Change-Id: Ie7c18f2f1b6294e3d19c36112d35f4472ce77e7b
2020-06-02 21:00:56 +02:00
chenghuiyu
00b5d3f245 Remove method blather in log adapter
As method blather was using in new place, it was deprecated for removal
in new release.

Change-Id: Ic8d425e1774d6b7090ec105f2b37467a90c6e1e6
Closes-Bug: #1714873
2017-09-04 14:06:56 +08:00
Joshua Harlow
522ea98489 Move all internal blather usage/calls to trace usage/calls
Change-Id: I415a81d3b6b15b17a9a91cc2a0681c159172a4e1
2015-12-17 22:39:14 -08:00
Joshua Harlow
cf99c89e22 Start rename of BLATHER -> TRACE
This appears to be standardizing around the name
TRACE instead of BLATHER so start to move taskflow
internally to use this name instead.

Change-Id: I095039ac556eb07b821a29528b1b76651bcbab5c
2015-12-16 17:47:33 -08:00
Joshua Harlow
b64b2b78b6 Remove legacy py2.6 backwards logging compat. code
We no longer provide support for py2.6 so we don't
need the logging compatibility code to exist anymore.

Change-Id: Iaefab67fd8b4e222475d99f57c2c3a7a5ce07d6e
2015-07-23 13:55:22 -07:00
Joshua Harlow
56ca354123 Handy access to INFO level
It appears that the INFO log level does not have
itself exposed for handy access, so fix that.

Change-Id: I74582e645ad883f33b08a460756b84a0a2d25b51
2015-06-12 09:05:41 -07:00
Joshua Harlow
f1457a02ae Ensure message gets processed correctly
Make sure that we call the local log() function and not
the adapted loggers log function to ensure that we pick
up the adapters potentially existing extra values.

Change-Id: I6cb027bab5c32bc4a24be683aec88f397c0cd707
2014-12-10 18:58:42 -08:00
Joshua Harlow
14431bc076 Add and use a new simple helper logging module
Add a new logging BLATHER level to easily allow its
usage for messages that are below the normal DEBUG level
such as compilation information and scope lookup info
which can be very verbose in logs if always enabled.

Change-Id: I828211403bd02bfd6777b10cdcfe58fb0637a52c
2014-12-08 22:09:13 -08:00