Merge ~clinton-fung/launchpadlib:remove-indentation-parenthesis-in-url-output into launchpadlib:main

Proposed by Clinton Fung
Status: Needs review
Proposed branch: ~clinton-fung/launchpadlib:remove-indentation-parenthesis-in-url-output
Merge into: launchpadlib:main
Diff against target: 13 lines (+1/-1)
1 file modified
src/launchpadlib/credentials.py (+1/-1)
Reviewer Review Type Date Requested Status
Colin Watson (community) Needs Information
Review via email: mp+437567@code.launchpad.net

Commit message

Remove indentation and parentheses when outputting URL for auth on the command-line, to make copy/paste easier and more predictable across platforms.

Description of the change

Currently, when executing `Launchpad.login_with()`, if authentication is required then a URL is printed to allow the user to open a browser and perform authentication.

This message looks something like:
```
The authorization page:
 (https://launchpad.net/+authorize-token?oauth_token=blah&allow_permission=DESKTOP_INTEGRATION)
should be opening in your browser. Use your browser to authorize
this program to access Launchpad on your behalf.
Waiting to hear from Launchpad about your decision...
```

It would be helpful if the indentation and parentheses around the URL were removed, to make copy/paste easier (and presumably to make the URL easier to read for machines in automation).

This change simply removes the indentation and parentheses.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

I'd like to keep the indentation if possible (perhaps increased to two or four spaces), since it marks it out from the surrounding prose a bit more clearly. Both Firefox and Chromium trim leading spaces from URLs, presumably to make this sort of pattern work more easily, so I don't think that should be as much of a problem as the parentheses. Do you agree?

review: Needs Information

Unmerged commits

bf031cf... by Clinton Fung

Remove indentation and parentheses when outputting URL for auth on the command-line, to make copy/paste easier and more predictable across platforms.

Succeeded
[SUCCEEDED] lint:0 (build)
[SUCCEEDED] tests:0 (build)
12 of 2 results

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/launchpadlib/credentials.py b/src/launchpadlib/credentials.py
2index 5789fc0..63fc32a 100644
3--- a/src/launchpadlib/credentials.py
4+++ b/src/launchpadlib/credentials.py
5@@ -731,7 +731,7 @@ class AuthorizeRequestTokenWithBrowser(AuthorizeRequestTokenWithURL):
6
7 WAITING_FOR_USER = (
8 "The authorization page:\n"
9- " (%s)\n"
10+ "%s\n"
11 "should be opening in your browser. Use your browser to authorize\n"
12 "this program to access Launchpad on your behalf."
13 )

Subscribers

People subscribed via source and target branches