Skip to content

Commit

Permalink
fix(pr,repo): positional args no's corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
psadi committed Apr 19, 2024
1 parent aaf8291 commit e178797
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 47 deletions.
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
<div id="texts" style="white-space:nowrap;">
<img height="100" width="100" src="./resources/bb.png" align="left"/>
<h1>Bitbucket-CLI (bb) </h1>
<h3>Work seamlessly with Bitbucket from the command line</h3>
</br>
</div>
## Bitbucket CLI (bb)
Work seamlessly with Bitbucket from the command line

![](https://img.shields.io/badge/license-MIT-green.svg?style=flat)
[![Continuous Integration](https://github.com/psadi/bbcli/actions/workflows/ci.yml/badge.svg)](https://github.com/psadi/bbcli/actions/workflows/ci.yml)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=psadi_bbcli&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=psadi_bbcli)



<a href="https://www.buymeacoffee.com/addy3494" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 22px !important;width: 100px !important;" ></a>

---
Expand Down
9 changes: 5 additions & 4 deletions bb/__version__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
"""
bb.__version__
Sets the packge version, picked dynamically by
the utility and pyproject
bb.__version__
Sets the packge version, picked dynamically by
the utility and pyproject
"""
__version__ = "0.5.7"

__version__ = "0.5.8"
4 changes: 1 addition & 3 deletions bb/pr/copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ def copy_pull_request(_id: str) -> None:
username, token, bitbucket_host = ini.parse()
project, repository = cmnd.base_repo()
url: str = request.get(
bitbucket_api.pull_request_info(bitbucket_host, project, repository, _id),
username,
token,
bitbucket_api.pull_request_info(project, repository, _id),
)[1]["links"]["self"][0]["href"]
cmnd.cp_to_clipboard(url)
live.update(richprint.console.print("COPIED", style="bold green"))
Expand Down
8 changes: 4 additions & 4 deletions bb/repo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def delete(
@error_handler
def _delete(project, repo):
project = validate_input(project, vars.project_name, vars.project_cant_be_none)
repo = validate_input(repo, vars.repoitory_name, vars.repo_cant_be_none)
repo = validate_input(repo, vars.repository_name, vars.repo_cant_be_none)

delete_repository(project, repo)

Expand All @@ -63,7 +63,7 @@ def archive(
@error_handler
def _archive(project, repo):
project = validate_input(project, vars.project_name, vars.project_cant_be_none)
repo = validate_input(repo, vars.repoitory_name, vars.repo_cant_be_none)
repo = validate_input(repo, vars.repository_name, vars.repo_cant_be_none)

archive_repository(project, repo, True)

Expand All @@ -80,7 +80,7 @@ def unarchive(
@error_handler
def _unarchive(project, repo):
project = validate_input(project, vars.project_name, vars.project_cant_be_none)
repo = validate_input(repo, vars.repoitory_name, vars.repo_cant_be_none)
repo = validate_input(repo, vars.repository_name, vars.repo_cant_be_none)

archive_repository(project, repo, False)

Expand All @@ -99,7 +99,7 @@ def create(
@error_handler
def _create(project, repo, forkable, default_branch):
project = validate_input(project, vars.project_name, vars.project_cant_be_none)
repo = validate_input(repo, vars.repoitory_name, vars.repo_cant_be_none)
repo = validate_input(repo, vars.repository_name, vars.repo_cant_be_none)

create_repository(project, repo, forkable, default_branch)

Expand Down
2 changes: 1 addition & 1 deletion bb/repo/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def archive_repository(project: str, repo: str, archive: bool) -> None:
if request[0] == 200:
live.update(console.print("DONE", style="bold green"))

if request[0] == 409:
if request[0] in (403, 409):
live.update(console.print("CONFLICT", style="bold yellow"))
console.print(
f"Message: {request[1]['errors'][0]['message']}",
Expand Down
2 changes: 1 addition & 1 deletion bb/repo/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def create_repository(
) -> None:
with live_progress(f"Creating '{project}/{repo}' Repository ... ") as live:
request = post(
bitbucket_api.create_repo(project, repo),
bitbucket_api.create_repo(project),
json.dumps(
{
"name": repo,
Expand Down
2 changes: 1 addition & 1 deletion bb/utils/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def put(url: str, body: dict) -> list[int, dict]:
timeout=10.0,
)

if request.status_code not in (200, 409):
if request.status_code not in (200, 403, 409):
raise ValueError(
f"\n[{request.status_code}] {http_response_definitions(request.status_code)}"
)
Expand Down
48 changes: 24 additions & 24 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e178797

Please sign in to comment.