Skip to content

Commit 5424773

Browse files
committed
🚒 show generated URL in get_auth_token()
Signed-off-by: Guyzmo <[email protected]>
1 parent b8ce99b commit 5424773

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

git_repo/services/ext/gitbucket.py

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,15 @@
1313
class GitbucketService(GithubService):
1414
fqdn = "localhost"
1515
port = 8080
16+
1617
def __init__(self, *args, **kwarg):
1718
super(GitbucketService, self).__init__(*args, **kwarg)
1819

1920
@classmethod
2021
def get_auth_token(cls, login, password, prompt=None):
21-
print("Please open the following URL: https://yourgitbucket/youraccount/_application")
22+
print("Please open the following URL: {}/{}/_application".format(cls.build_url(cls), login))
2223
print("Generate a new token, and paste it at the following prompt.")
2324
return prompt('token> ')
24-
## this code maybe works when GitBucket supports add access token API.
25-
#print("build_url: ", cls.build_url(cls))
26-
#import platform
27-
#gh = github3.GitHubEnterprise(cls.build_url(cls))
28-
#gh.login(login, password, two_factor_callback=lambda: prompt('2FA code> '))
29-
#try:
30-
# auth = gh.authorize(login, password,
31-
# scopes=[ 'repo', 'delete_repo', 'gist' ],
32-
# note='git-repo2 token used on {}'.format(platform.node()),
33-
# note_url='https://github.com/guyzmo/git-repo')
34-
# return auth.token
35-
#except github3.models.GitHubError as err:
36-
# if len(err.args) > 0 and 422 == err.args[0].status_code:
37-
# raise ResourceExistsError("A token already exist for this machine on your github account.")
38-
# else:
39-
# raise err
4025

4126
def format_path(self, repository, namespace=None, rw=False):
4227
repo = repository

0 commit comments

Comments
 (0)