pyFileZilla API

ftpSettings

class pyFileZilla.ftpSettings(config_file=None)

A wrapper for a FileZilla Server configuration.

Parameters:config_file – The XML configuration file - may be a file name or file-like object. If no file is provided, the object will be initialized with an empty configuration file.
addGroup(name)

Adds a new ftpGroup to the configuration.

Parameters:name – The name of the new group. Raises GroupExistsError if the name is not unique.
Returns:the new ftpGroup object.
addUser(name)

Adds a new ftpUser to the configuration.

Parameters:name – The name of the new user. Raises UserExistsError if the name is not unique.
Returns:The new ftpUser object.
load(config_file)

Loads the configuration from a file.

Parameters:config_file – The XML configuration file - may be a file name or file-like object.
removeGroup(name)

Removes a ftpGroup from the configuration.

Parameters:name – The name of the group to remove. Raises KeyError if the group does not exist.
removeUser(name)

Removes a ftpUser from the configuration.

Parameters:name – The name of the user to remove. Raises KeyError if the user does not exist.
write(config_file)

Writes the configuration to a file.

Parameters:config_file – The file object to write the XML configuration to. The object should have a write() function.

ftpUser

class pyFileZilla.ftpUser(**kwargs)

A user account

addPermission(directory)

Adds a ftpPermission to the permissions list.

Parameters:directory – The path to the directory. Raises Exception if the user already has a permission for the directory.
Returns:The added ftpPermission object.
clearPermissions()

Removes all permissions.

comments

A string used for additional information

enabled

The object is enabled.

group

The name of the group that the user belongs to

setPassword(password)

Set the password for the user account

Args:
password (str): the new password (pass empty string or None to remove password)

ftpGroup

class pyFileZilla.ftpGroup(**kwargs)

A group

addPermission(directory)

Adds a ftpPermission to the permissions list.

Parameters:directory – The path to the directory. Raises Exception if the user already has a permission for the directory.
Returns:The added ftpPermission object.
clearPermissions()

Removes all permissions.

comments

A string used for additional information

enabled

The object is enabled.

filezilla_reload_config()

pyFileZilla.ftpSettings.filezilla_reload_config(filezilla_exe_path)

A convenience function for reloading the FileZilla Server configuration.

Executes the server executable with reload-config command line switch.

Note

The call uses Windows style command arguments, so it will not work in other OSes.

Parameters:filezilla_exe_path – The path to the FileZilla Server executable.

Table Of Contents

Previous topic

Usage

This Page