univention.management.console.modules.distribution package#

univention.management.console.modules.distribution.compare_dn(a, b)[source]#
class univention.management.console.modules.distribution.Instance(*args, **kwargs)[source]#

Bases: SchoolBaseModule

init()[source]#

this function is invoked after the module process started.

destroy()[source]#

this function is invoked before the module process is exiting.

upload(request)[source]#
checkfiles(request)[source]#

Checks whether the given filename has already been uploaded:

request.options: { ‘filenames’: [ ‘…’, … ], project: ‘…’ }

returns: {

‘filename’: ‘…’, ‘sessionDuplicate’: True|False, ‘projectDuplicate’: True|False, ‘distributed’: True|False

}

query(request)[source]#
put(request)[source]#

Modify an existing project

add(request)[source]#

Add a new project

get(request)[source]#

Returns the objects for the given IDs

requests.options = [ <ID>, … ]

return: [ { … }, … ]

distribute(request)[source]#
collect(request)[source]#
adopt(request)[source]#
remove(request)[source]#

Removes the specified projects

Submodules#

univention.management.console.modules.distribution.util module#

exception univention.management.console.modules.distribution.util.DistributionException[source]#

Bases: Exception

exception univention.management.console.modules.distribution.util.InvalidProjectFilename[source]#

Bases: DistributionException

univention.management.console.modules.distribution.util.jsonEncode(val)[source]#

Encode to JSON using the custom _Dict encoder.

univention.management.console.modules.distribution.util.jsonDecode(val)[source]#

Decode a JSON string and replace dict types with _Dict.

class univention.management.console.modules.distribution.util.User(*args, **_props)[source]#

Bases: _Dict

property homedir#
school_lib_user(lo)[source]#
class univention.management.console.modules.distribution.util.Group(*args, **_props)[source]#

Bases: _Dict

univention.management.console.modules.distribution.util.openRecipients(entryDN, ldap_connection)[source]#
class univention.management.console.modules.distribution.util.Project(*args, **_props)[source]#

Bases: _Dict

property projectfile#

The absolute project path to the project file.

property cachedir#

The absolute path of the project cache directory.

property sender_projectdir#

The absolute path of the project directory in the senders home.

property atJobDistribute#
property atJobCollect#
property num_results#
user_projectdir(user)[source]#

Return the absolute path of the project dir for the specified user.

property starttime#
property deadline#
validate()[source]#

Validate the project data. In case of any errors with the data, a ValueError with a proper error message is raised.

isNameInUse()[source]#

Verifies whether the given project name is already in use.

save()[source]#

Save project data to disk and create job. In case of any errors, an IOError is raised.

getRecipients()[source]#
distribute(usersFailed=None)[source]#

Distribute the project data to all registrated receivers.

collect(dirsFailed=None, readOnly=False, compress=False)[source]#
purge()[source]#

Remove project’s cache directory, project file, and at job registrations.

static sanitize_project_filename(path)[source]#

sanitize project filename - if the file fn_project lies outside DISTRIBUTION_DATA_PATH any user is able to place a json project file and use that for file distribution/collection.

static load(projectfile)[source]#

Load the given project file and create a new Project instance.

static list(only_distributed=False)[source]#
univention.management.console.modules.distribution.util.initPaths()[source]#