Skip to content

Commit e7ffaf3

Browse files
author
Jens Kürten
committed
improve docstrings
1 parent b5cda04 commit e7ffaf3

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

csfunctions/service/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
from csfunctions.metadata import MetaData
2+
from csfunctions.service.base import Conflict, NotFound, Unauthorized, UnprocessableEntity
23
from csfunctions.service.file_upload import FileUploadService
34
from csfunctions.service.numgen import NumberGeneratorService
45

6+
__all__ = [
7+
"Service",
8+
"FileUploadService",
9+
"NumberGeneratorService",
10+
"Conflict",
11+
"NotFound",
12+
"Unauthorized",
13+
"UnprocessableEntity",
14+
]
15+
516

617
class Service:
718
"""

csfunctions/service/file_upload.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ def upload_file_content(
141141
check_access: Whether to check access permissions.
142142
filesize: Size of the file in bytes (required only if the stream is not seekable).
143143
delete_derived_files: Whether to delete derived files after upload.
144+
145+
Raises:
146+
csfunctions.service.Unauthorized: If access check fails.
147+
csfunctions.service.Conflict: If the file is already locked.
148+
csfunctions.service.NotFound: If the file object does not exist.
144149
"""
145150
persno = persno or self.metadata.app_user
146151
if filesize is None:
@@ -197,6 +202,10 @@ def upload_new_file(
197202
198203
Returns:
199204
The ID of the newly created file object.
205+
206+
Raises:
207+
csfunctions.service.Unauthorized: If access check fails.
208+
csfunctions.service.NotFound: If the parent object does not exist.
200209
"""
201210
persno = persno or self.metadata.app_user
202211
file_object_id = self._create_new_file(

0 commit comments

Comments
 (0)