Skip to content

Commit

Permalink
refactor: remove dockerfile and docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
antwxne committed Jun 9, 2022
1 parent 4384db9 commit 3944327
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 39 deletions.
9 changes: 0 additions & 9 deletions Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ task = API.create_task(task)

All the documentation is made with _python google docstring_.

## Contributeurs
## Contributors

- Antoine Desruet [![github-link][github-logo]](https://github.com/antwxne)

Expand Down
11 changes: 0 additions & 11 deletions docker-compose.yml

This file was deleted.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="CVAT wrapper",
version="0.0.9",
version="0.0.10",
author="antwxne",
author_email="[email protected]",
description="Python wrapper for CVAT API",
Expand Down
15 changes: 1 addition & 14 deletions src/CVAT/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,4 @@ def __init__(self, username: str = "admin", password: str = "admin", url: str =
if response.status_code != 200:
raise ValueError("Bad credentials")

def create_user(self, user_name: str, user_mail: str, password: str, first_name: str, last_name: str) -> None:
body: dict = {
"username": user_name,
"email": user_mail,
"password1": password,
"password2": password,
"first_name": first_name,
"last_name": last_name,
"confirmations": []
}
response: Response = self.session.post(url=f'{self.url}/api/auth/register',
json=body)
if response.status_code != 201:
raise Exception(response.content)

25 changes: 25 additions & 0 deletions src/CVAT/_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,28 @@ def add_local_images_to_task(self, task: Task, images_path: list[str], quality:

if response.status_code != 202:
raise Exception(response.content)

def create_user(self, user_name: str, user_mail: str, password: str, first_name: str, last_name: str) -> None:
"""
It creates a user with the given parameters
Args:
user_name (str): The username of the user you want to create.
user_mail (str): The email address of the user.
password (str): The password for the user.
first_name (str): The first name of the user
last_name (str): str, first_name: str, user_mail: str, user_name: str, password: str
"""
body: dict = {
"username": user_name,
"email": user_mail,
"password1": password,
"password2": password,
"first_name": first_name,
"last_name": last_name,
"confirmations": []
}
response: Response = self.session.post(url=f'{self.url}/api/auth/register',
json=body)
if response.status_code != 201:
raise Exception(response.content)
2 changes: 0 additions & 2 deletions src/CVAT/data_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,6 @@ def from_json(json_response: dict):
new_obj.attributes = [TrackedShape.from_json(shape) for shape in
shapes] if shapes is not None else []
new_obj.attributes = get_key_value(json_response, "attributes")
# new_obj.attributes = [AttributeVal.from_json(attribute) for attribute in
# attributes] if attributes is not None else []
return new_obj


Expand Down
2 changes: 1 addition & 1 deletion src/CVAT/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from tqdm import tqdm

from src.CVAT import CVAT
from . import CVAT


def tryint(s):
Expand Down

0 comments on commit 3944327

Please sign in to comment.