Request parser

This submodule provides ability to process and parse import requests.

Most important function in this matter is the process_import_request(), which is called from from ftp.monitor.process_log(). When it is called, it scans the user’s home directory, detects new files, pairs them together into proper objects (see ftp.structures, speficifally MetadataFile, EbookFile and DataPair).

API

ftp.request_parser.process_import_request(username, path, timestamp, logger_handler)[source]

React to import request. Look into user’s directory and react to files user uploaded there.

Behavior of this function can be set by setting variables in ftp.settings.

Parameters:
  • username (str) – Name of the user who triggered the import request.
  • path (str) – Path to the file, which triggered import request.
  • timestamp (float) – Timestamp of the event.
  • logger_handler (object) – Python logger. See logging for details.
Returns:

:ImportRequest.