198 Commits

Author SHA1 Message Date
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
069a6926c0 Implement conventions found by pylint
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-31 17:28:33 +01:00
Benjamin Drung
444b319c12 Implement refactorings found by pylint
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-31 16:58:24 +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
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
Mattia Rizzolo
434ca8952e
Merge branch 'python3' of git+ssh://git.launchpad.net/ubuntu-dev-tools
MR: https://code.launchpad.net/~ubuntu-dev/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/372305
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-09-10 14:19:07 +02:00
Dan Streetman
a7d166b52f pull-pkg: use ubuntutools/version/Version
instead of debian.debian_support.Version, use ubuntutools version,
which extends it and adds the strip_epoch() function which is
needed to convert full version string to version used in filenames
2019-09-09 12:25:21 -04:00
Stefano Rivera
b311cebaed More requestsync porting and cleanup 2019-09-04 19:24:44 -03:00
Scott Kitterman
81b17cd323 Update requestsync to python3 (Closes: #927147) 2019-09-04 19:24:44 -03:00
Benjamin Drung
cc7170eccb Fix all flake8 issues 2017-05-01 00:20:03 +02:00
Benjamin Drung
b07271fdf8 Remove unused imports. 2013-10-23 00:36:12 +02:00
Dmitrijs Ledkovs
585902ad87 always done from unstable. Adjust requstsync & syncpackage to always
default to unstable.
2013-10-22 18:58:48 +01:00
Stefano Rivera
e15667aa2f requestsync: We now sync to proposed (LP: #1073060) 2012-10-30 10:18:17 +01:00
Stefano Rivera
343ac49b39 pbuilder-dist, pull-debian-source, pull-lp-source, requestsync,
reverse-depends, submittodebian, syncpackage:
Handle outdated distro-info data. Fall back to sane defaults where
possible.
2012-05-06 10:15:54 +02:00
Stefano Rivera
42a76abaa7 Catch SeriesNotFoundException and display a friendly error (LP: #963888) 2012-03-28 23:51:17 +02:00
Stefano Rivera
d9bf247dee * requestsync:
- New packages from non-free or contrib go into multiverse (LP: #935643)
2012-03-28 23:43:29 +02:00
Evan Broder
cb225bd8f2 sponsor-patch, requestsync, syncpackage: Add a config variable for -k arguments 2012-02-11 11:59:46 -08:00
Stefano Rivera
09e468211a Add changelog retrieval to lpapicache, and use this in syncpackage and
requestsync. The changelogs should be available in Launchpad sooner than
Debian PTS.
2011-11-13 22:50:34 +02:00
Stefano Rivera
cefbe3ccc2 * New scripts:
- reverse-depends: Replaces reverse-build-depends. Uses an UbuntuWire
    webservice for determining all reverse(-build)-dependencies for a
    package. (LP: #696373)
  - requestbackport: Files a backport request bug report, including a full
    testing checklist.
* Don't allow boilerplate prompts through in submittodebian and requestsync
  (LP: #887336)
2011-11-13 21:31:01 +02:00
Stefano Rivera
629fbd14ad optional_edit was a silly idea 2011-11-13 20:53:39 +02:00
Stefano Rivera
d4fbed617f Use EditBugReport instead of requestsync's edit_report. Drop that. 2011-11-13 20:15:19 +02:00
Stefano Rivera
8aefff3758 requestsync: Make --lp the default. 2011-11-12 23:33:32 +02:00
Stefano Rivera
aab58522ad syncpackage, requestsync: Sync from testing for LTSs (LP: #876400) 2011-10-17 13:31:02 +02:00
Benjamin Drung
1c814c8ec6 ubuntutools/requestsync: Follow PEP 8 naming conventions. 2011-09-10 15:42:40 +02:00
Stefano Rivera
cd236932de * requestsync: Extract current Ubuntu delta from changelog entries and provide for editing (LP: #547925)
* Bump python-debian B-D and Depends to 0.1.20 for unicode Changelog reading.
2011-09-10 10:28:41 +02:00
Benjamin Drung
e47bff4bed requestsync: Do not crash on user abort (Closes: #637168). 2011-09-06 13:24:25 +02:00
Colin Watson
1d68d8064c add note on requestsync stderr about syncpackage 2011-08-17 16:48:17 +01:00
Benjamin Drung
a03fa654f3 Move debian-distro-info, distro-info, and ubuntu-distro-info from
ubuntu-dev-tools into distro-info.
2011-06-25 17:53:44 +02:00
Stefano Rivera
95e7b5cd44 requestsync: Use from...import require_utf8() to work around unexpected
scoping from a later import (LP: #723630)
2011-02-23 14:47:19 +02:00
Stefano Rivera
d054dcf796 requestsync, grep-merges: Require a UTF-8 locale. (Closes: #613114,
LP: #553795)
2011-02-13 16:15:24 +02:00
Benjamin Drung
dccc33c454 requestsync: Fix intentation. 2011-02-01 12:11:20 +01:00
Stefano Rivera
773c5c33e0 Rework Scott's requestsync modifications for robustness and staging-support 2011-02-01 10:10:31 +02:00
Scott Kitterman
f8f79ecf99 * Update requestsync to send to Launchpad's MX record instead of hard
coding to the old MX (fiordland)
  * Recommend python-dns
2011-01-31 18:37:23 -05:00
Benjamin Drung
1a8951e82d Use new ubuntutools.distro_info in various scripts. 2011-01-21 19:20:04 +01:00
Benjamin Drung
086ca39f10 requestsync: Make pylint happier. 2010-12-27 20:06:23 +01:00
Benjamin Drung
c19ff094b1 Make pylint a little bit happier. 2010-12-27 16:54:23 +01:00
Stefano Rivera
9fa9f3eb96 Whitespace and style cleanups 2010-12-23 00:01:39 +02:00
Stefano Rivera
f01beda01c Convert last Python code from mixed tabs and spaces to spaces 2010-12-22 23:04:29 +02:00
Stefano Rivera
b46114c20f Move up mailserver config parsing, so we return deprecation errors fast 2010-12-22 00:11:10 +02:00
Stefano Rivera
692627c771 Restore -l 2010-12-21 21:54:57 +02:00
Stefano Rivera
a435c3234b Use the improved staging support in lpapicache 2010-12-21 21:52:12 +02:00
Stefano Rivera
82eab1c349 Config file support in requestsync 2010-12-21 17:02:36 +02:00
Stefano Rivera
b1b1e5e332 requestsync: Style: named parameters shouldn't have spaces around = 2010-12-21 12:32:33 +02:00
Stefano Rivera
9dd04a43ba requestsync: Convert the space-indented lines to tabs 2010-12-21 12:26:00 +02:00
Stefano Rivera
8588c064b7 ubuntutools.common is gone 2010-12-21 02:17:04 +02:00
Benjamin Drung
1943df29eb Remove all trailing spaces. 2010-12-03 00:06:43 +01:00