Skip to content

hertzforge.service.uploads

uploads

Files a browser sends by their contents, for project.import and project.open.

A browser gives the shell a dropped file's contents and its name, never its path, so the shell sends the contents in pieces (project.upload) and then names the upload in place of a path. Each upload is written to a folder of this connection's own, under the file's own name so the readers recognize its format and their messages name it, and stays there until the connection closes: a project opened from one maps its large arrays from that file.

Classes:

Name Description
Upload

One file being received: its name, the size it was announced at, where it is written and

Uploads

The files one connection has been sent, by the id project.upload answered.

Functions:

Name Description
sweep

Remove the folders of received files that a service no longer running left behind, as

Classes

Upload dataclass

Upload(name: str, size: int, path: str, received: int = 0)

One file being received: its name, the size it was announced at, where it is written and how much of it has come.

Attributes:

Name Type Description
complete bool

Whether every byte announced has come.

Attributes
complete property
complete: bool

Whether every byte announced has come.

Uploads

Uploads()

The files one connection has been sent, by the id project.upload answered.

Methods:

Name Description
receive

project.upload: one piece of a file, data (u8) at offset. The first piece, at 0

taken

The upload project.import or project.open names, refused until all of it has

close

The connection closed: every file it was sent goes.

Methods:
receive
receive(params: Mapping[str, Any]) -> dict[str, Any]

project.upload: one piece of a file, data (u8) at offset. The first piece, at 0 and with no upload, starts the file and names it (name, the file's own name) and its size in bytes; each later piece names the upload the first answered and comes at the offset received so far. Answers the upload's id and the bytes received.

taken
taken(ident: Any) -> Upload

The upload project.import or project.open names, refused until all of it has come.

close
close() -> None

The connection closed: every file it was sent goes.

Functions:

sweep

sweep(folder: str | None = None) -> list[str]

Remove the folders of received files that a service no longer running left behind, as one stopped before its connections closed does, and answer them. A folder is a service's while the process its name carries is running.