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
diff --git a/src/launchpadlib/credentials.py b/src/launchpadlib/credentials.py
index 5789fc0..63fc32a 100644
--- a/src/launchpadlib/credentials.py
+++ b/src/launchpadlib/credentials.py
@@ -731,7 +731,7 @@ class AuthorizeRequestTokenWithBrowser(AuthorizeRequestTokenWithURL):
731731
732 WAITING_FOR_USER = (732 WAITING_FOR_USER = (
733 "The authorization page:\n"733 "The authorization page:\n"
734 " (%s)\n"734 "%s\n"
735 "should be opening in your browser. Use your browser to authorize\n"735 "should be opening in your browser. Use your browser to authorize\n"
736 "this program to access Launchpad on your behalf."736 "this program to access Launchpad on your behalf."
737 )737 )

Subscribers

People subscribed via source and target branches