ucsschool.http_api.import_api package

Submodules

ucsschool.http_api.import_api.admin module

ucsschool.http_api.import_api.apps module

App registry

class ucsschool.http_api.import_api.apps.HttpApiConfig(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

name = u'import_api'
verbose_name = u'UCS@school import API'

ucsschool.http_api.import_api.constants module

Constants

ucsschool.http_api.import_api.http_api_import_frontend module

UCS@school import frontend class

class ucsschool.http_api.import_api.http_api_import_frontend.ArgParseFake(**kwargs)[source]

Bases: object

class ucsschool.http_api.import_api.http_api_import_frontend.HttpApiImportFrontend(import_job, task, logger)[source]

Bases: ucsschool.importer.frontend.user_import_cmdline.UserImportCommandLine

Fake cmdline import frontend class. Simulates argparse results and starts import.

http_api_specific_config = u'user_import_http-api.json'
import_initiator = u'HTTP API'
reader_class = u'ucsschool.importer.reader.http_api_csv_reader.HttpApiCsvReader'
parse_cmdline()[source]
setup_logging(stdout=False, filename=None, uid=None, gid=None, mode=None)[source]
configuration_files

User import configuration files.

Returns:list of filenames
Return type:list(str)
static make_job_state(description, percentage=0, done=0, total=0, celery_task_state='STARTED', **kwargs)[source]
setup_config()[source]
update_job_state(description, percentage=0, done=0, total=0, celery_task_state='STARTED', **kwargs)[source]

Update import job task state.

Parameters:
  • description (str) – the description
  • percentage (int) – progress
  • done (int) – if it was done
  • total (int) – number of objects
  • celery_task_state (celery.states) – one of the states from celery.states
  • kwargs (dict) – will be saved into job result.meta together with other arguments
Returns:

None

ucsschool.http_api.import_api.import_logging module

ucsschool.http_api.import_api.models module

ucsschool.http_api.import_api.serializers module

ucsschool.http_api.import_api.tasks module

ucsschool.http_api.import_api.utils module

Diverse helper functions.

ucsschool.http_api.import_api.utils.get_wsgi_user_group()[source]

Get the username and group name of the WSGI process in which the HTTP-API runs.

Returns:tuple with username and group name
Return type:tuple(str, str)
ucsschool.http_api.import_api.utils.get_wsgi_uid_gid()[source]

Get the UID and GID of the WSGI process in which the HTTP-API runs.

Returns:tuple with UID and GID
Return type:tuple(int, int)

ucsschool.http_api.import_api.views module