3
0
mirror of https://git.launchpad.net/ubuntu-dev-tools synced 2025-03-13 08:01:09 +00:00

22 Commits

Author SHA1 Message Date
Benjamin Drung
c8a757eb07 Format Python code with black 23.1
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-04-04 12:11:36 +02:00
Benjamin Drung
aa556af89d Use f-strings
pylint complains about C0209: Formatting a regular string which could be
a f-string (consider-using-f-string)

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-31 19:32:58 +01:00
Benjamin Drung
909d945af4 Replace deprecated optparse with argparse
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-31 13:33:18 +01:00
Benjamin Drung
f6fde2e217 fix: Use lazy % formatting in logging functions
pylint complains about W1201: Use lazy % formatting in logging functions
(logging-not-lazy) and W1203: Use lazy % formatting in logging functions
(logging-fstring-interpolation).

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-31 11:13:07 +01:00
Benjamin Drung
b1bc7e1cdc Address pylint complaints
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-30 23:10:31 +01:00
Benjamin Drung
4e27045f49 style: Sort Python imports with isort
```
isort -l 99 --profile=black .
```

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-30 21:28:47 +01:00
Benjamin Drung
3354b526b5 style: Format Python code with black
```
PYTHON_SCRIPTS=$(grep -l -r '^#! */usr/bin/python3$' .)
black -C -l 99 . $PYTHON_SCRIPTS
```

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-30 19:45:36 +01:00
Dan Streetman
0eeb93ee0c logging: update ubuntutools.getLogger() to output to stdout/stderr correctly
Python logging by default sends all output to stderr, but that's not what
normal programs usually do and is not expected for these scripts.

Change the ubuntutools.getLogger() method to return a logger with handlers
correctly set up to send INFO level (or lower) logs to stdout and WARNING
level (or higher; technically INFO+1 level or higher) logs to stderr.

This results in normally logged output going to stdout and warnings/errors
going to stderr, as expected.
2021-02-02 06:25:12 -05:00
Dan Streetman
90e8fe81e1 replace ubuntutools.logger with standard python logging 2019-11-25 10:10:06 -05:00
Stefano Rivera
3052bfcc16 Port grep-merges to python 3 2019-09-04 19:24:44 -03:00
Steve Langasek
7143367610 grep-merges: flake8-clean.
Signed-off-by: Steve Langasek <steve.langasek@ubuntu.com>
2019-05-07 21:32:04 -07:00
Steve Langasek
fec29f22bc grep-merges: support grepping by team name (full name match)
Signed-off-by: Steve Langasek <steve.langasek@ubuntu.com>
2019-05-07 18:24:07 -07:00
Benjamin Drung
cc7170eccb Fix all flake8 issues 2017-05-01 00:20:03 +02:00
James Page
e56c0fce43 grep-merges: Use unicode string format for pretty output to deal with
non ascii encoding.
2016-08-04 17:15:13 +01:00
Martin Pitt
4d07f85874 grep-merges: Do not override author or uploader with None
There can be JSON entries which have uploader=None.
2016-05-13 09:04:55 +02:00
Dmitry Shachnev
3a425de23e grep-merges: Do not override author or uploader with None
There can be JSON entries which have uploader=None, and such entries would
lead to TypeError when trying to use ' '.join().
2016-04-27 13:05:54 +03:00
Stefano Rivera
ed96c35dc1 grep-merges: Use optparse to display --help 2012-05-06 05:24:14 +02:00
Andreas Moog
3fca602809 grep-merges: We already require a UTF-8 enabled terminal, so encode
package and uploader name in UTF-8 (LP: )
2011-11-30 21:05:17 +01:00
Stefano Rivera
70a035f13d Use httplib2 everywhere that we do https. The python stdlib doesn't do
certificate verification.
2011-11-22 15:57:02 +02:00
Stefano Rivera
d054dcf796 requestsync, grep-merges: Require a UTF-8 locale. (Closes: ,
LP: )
2011-02-13 16:15:24 +02:00
Benjamin Drung
b09ddfee2f Make pylint happier. 2010-12-27 21:54:31 +01:00
Colin Watson
61495065ec grep-merges: New tool. 2010-12-15 14:50:54 +00:00