gufo.blob.common.ftp¶
Common FTP definitions and utilities.
FTPFeatures
dataclass
¶
FTP Server features.
Attributes:
| Name | Type | Description |
|---|---|---|
supports_mlsd |
bool
|
MLSD command is supported. |
supports_mlst |
bool
|
MLST command is supported. |
supports_size |
bool
|
SIZE command is supported. |
from_feat(feat)
classmethod
¶
Parse FEAT response.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
feat
|
list[bytes]
|
Feat response from FTP server |
required |
Returns:
| Type | Description |
|---|---|
FTPFeatures
|
Parsed FTPFeatures. |
iter_parent_dirs(key)
¶
Iterate all full paths to the parent.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
current key. |
required |
Returns:
| Type | Description |
|---|---|
Iterable[str]
|
All full paths to the parent directories. |
parse_list_line(line)
¶
Parse one line of LIST output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
line
|
bytes
|
input line. |
required |
Returns:
| Type | Description |
|---|---|
tuple[str, bool]
|
Tuple of (file name, is directory) |
Raises:
| Type | Description |
|---|---|
BlobError
|
on unparsable line. |