atfm#

Exploring files in your server directory

FileManager #

Aternos file manager class for viewing files structure

__init__(atserv) #

Aternos file manager class for viewing files structure

Parameters:

Name Type Description Default
atserv python_aternos.atserver.AternosServer

atserver.AternosServer instance

required

convert_size(num, measure) #

Converts "human" file size to size in bytes

Parameters:

Name Type Description Default
num Union[int, float]

Size

required
measure str

Units (B, kB, MB, GB)

required

Returns:

Type Description
float

Size in bytes

dl_file(path) #

Returns the file content in bytes (downloads it)

Parameters:

Name Type Description Default
path str

Path to file including its filename

required

Returns:

Type Description
bytes

File content

dl_world(world='world') #

Returns the world zip file content by its name (downloads it)

Parameters:

Name Type Description Default
world str

Name of world

'world'

Returns:

Type Description
bytes

ZIP file content

extract_size(fsize_raw) #

Parses file size from the LXML tree

Parameters:

Name Type Description Default
fsize_raw List[Any]

XPath parsing result

required

Returns:

Type Description
float

File size in bytes

get_file(path) #

Returns :class:python_aternos.atfile.AternosFile instance by its path

Parameters:

Name Type Description Default
path str

Path to the file including its filename

required

Returns:

Type Description
Optional[AternosFile]

atfile.AternosFile object

Optional[AternosFile]

if file has been found,

Optional[AternosFile]

otherwise None

list_dir(path='') #

Requests a list of files in the specified directory

Parameters:

Name Type Description Default
path str

Directory (an empty string means root)

''

Returns:

Type Description
List[AternosFile]

List of atfile.AternosFile objects