def login(self): user = self.config('user') if not user: user = input("BitBucket user: "******"Generate an application password at https://bitbucket.org/account/settings/app-passwords/ and enter it below" ) password = getpass.getpass("BitBucket password: "******"Authentication failed") self.config('password', password) location = '%s - do not share this file' % self.config_file if self.use_credential_helper: location = 'git\'s credential helper' print( "Your BitBucket authentication password is now stored in %s" % location) self.bb = bbapi.Bitbucket(user, password) self.me = self.bb.user(user) self.my_login = self.me.nickname
def login(self): passwordConfig = self.config('password') user, password = passwordConfig if isinstance( passwordConfig, tuple) else (None, passwordConfig) if not user: user = self.config('user') if not user: user = raw_input("BitBucket user: "******"BitBucket password for '%s': " % user) if not password: print('Please do not specify an empty password') self.login() return wrong_password = False try: self.bb = bbapi.Bitbucket(user, password) self.me = self.bb.user(user) except bbapi.BitBucketAuthenticationError: wrong_password = True if wrong_password: self.login() return self.config('password', password) location = '%s - do not share this file' % self.config_file if self.use_credential_helper: location = 'git\'s credential helper' print( "Your BitBucket authentication password is now stored in %s" % location) try: self.bb = None self.me = None if not self.bb: self.bb = bbapi.Bitbucket(user, password) if not self.me: self.me = self.bb.user(user) self.my_login = self.me.username return except bbapi.BitBucketAuthenticationError: self.config('password', None) self.login()
def login(self): user = self.config('user') if not user: user = raw_input("BitBucket user: "******"BitBucket password: "******"Authentication failed") self.config('password', password) print("Your BitBucket authentication password is now cached in ~/.gitspindle - do not share this file") self.bb = bbapi.Bitbucket(user, password) self.me = self.bb.user(user) self.my_login = self.me.username
def login(self): user = self.config('user') if not user: user = raw_input("BitBucket user: "******"BitBucket password: "******"Authentication failed") self.config('password', password) location = '%s - do not share this file' % self.config_file if self.use_credential_helper: location = 'git\'s credential helper' print("Your BitBucket authentication password is now stored in %s" % location) self.bb = bbapi.Bitbucket(user, password) self.me = self.bb.user(user) self.my_login = self.me.username