def askAccountInfoAndGetAccount(self): accountID = input("Provide Account ID: ") account = Account.get(accountID) if account is None: print( "Invalid Account ID: %s, try again with a valid Account ID\n" % accountID) return account
def choice_repository(): print 'Select repositories' arr = [] bb = bitbucket.BitBucket(g_usr,g_pwd) for repo in bb.user(g_usr).repositories(): name = repo['name'] arr.append(name) print '%d) %s' % (len(arr), name) idx = int_input('>>> ') if 0 < idx and idx <= len(arr): return arr[idx -1] return '' account = Account('~/.bitbacketpw') g_usr,g_pwd = account.get(); repo = choice_repository() if '' != repo: type = choice_clone_type() if CLONE_TYPE_SSH == type or CLONE_TYPE_HTTPS == type: git_clone(make_repo_url(repo, type))