Skip to content

Commit 3944327

Browse files
committed
refactor: remove dockerfile and docker compose
1 parent 4384db9 commit 3944327

8 files changed

Lines changed: 29 additions & 39 deletions

File tree

Dockerfile

Lines changed: 0 additions & 9 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ task = API.create_task(task)
2121

2222
All the documentation is made with _python google docstring_.
2323

24-
## Contributeurs
24+
## Contributors
2525

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

docker-compose.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="CVAT wrapper",
8-
version="0.0.9",
8+
version="0.0.10",
99
author="antwxne",
1010
author_email="[email protected]",
1111
description="Python wrapper for CVAT API",

src/CVAT/__init__.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,4 @@ def __init__(self, username: str = "admin", password: str = "admin", url: str =
3838
if response.status_code != 200:
3939
raise ValueError("Bad credentials")
4040

41-
def create_user(self, user_name: str, user_mail: str, password: str, first_name: str, last_name: str) -> None:
42-
body: dict = {
43-
"username": user_name,
44-
"email": user_mail,
45-
"password1": password,
46-
"password2": password,
47-
"first_name": first_name,
48-
"last_name": last_name,
49-
"confirmations": []
50-
}
51-
response: Response = self.session.post(url=f'{self.url}/api/auth/register',
52-
json=body)
53-
if response.status_code != 201:
54-
raise Exception(response.content)
41+

src/CVAT/_post.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,28 @@ def add_local_images_to_task(self, task: Task, images_path: list[str], quality:
9797

9898
if response.status_code != 202:
9999
raise Exception(response.content)
100+
101+
def create_user(self, user_name: str, user_mail: str, password: str, first_name: str, last_name: str) -> None:
102+
"""
103+
It creates a user with the given parameters
104+
105+
Args:
106+
user_name (str): The username of the user you want to create.
107+
user_mail (str): The email address of the user.
108+
password (str): The password for the user.
109+
first_name (str): The first name of the user
110+
last_name (str): str, first_name: str, user_mail: str, user_name: str, password: str
111+
"""
112+
body: dict = {
113+
"username": user_name,
114+
"email": user_mail,
115+
"password1": password,
116+
"password2": password,
117+
"first_name": first_name,
118+
"last_name": last_name,
119+
"confirmations": []
120+
}
121+
response: Response = self.session.post(url=f'{self.url}/api/auth/register',
122+
json=body)
123+
if response.status_code != 201:
124+
raise Exception(response.content)

src/CVAT/data_types.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,6 @@ def from_json(json_response: dict):
239239
new_obj.attributes = [TrackedShape.from_json(shape) for shape in
240240
shapes] if shapes is not None else []
241241
new_obj.attributes = get_key_value(json_response, "attributes")
242-
# new_obj.attributes = [AttributeVal.from_json(attribute) for attribute in
243-
# attributes] if attributes is not None else []
244242
return new_obj
245243

246244

src/CVAT/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from tqdm import tqdm
88

9-
from src.CVAT import CVAT
9+
from . import CVAT
1010

1111

1212
def tryint(s):

0 commit comments

Comments
 (0)