コード例 #1
0
    def save_engine_params(self, engine, **kwargs):
        """Map validated field values to engine data.

        Since form widgets may be nested or named differently than the keys
        in the :attr:`mediadrop.lib.storage.StorageEngine._data` dict, it is
        necessary to manually map field values to the data dictionary.

        :type engine: :class:`mediadrop.lib.storage.StorageEngine` subclass
        :param engine: An instance of the storage engine implementation.
        :param \*\*kwargs: Validated and filtered form values.
        :raises formencode.Invalid: If some post-validation error is detected
            in the user input. This will trigger the same error handling
            behaviour as with the @validate decorator.

        """
        StorageForm.save_engine_params(self, engine, **kwargs)
        ftp = kwargs['ftp']
        engine._data[FTP_SERVER] = ftp['server']
        engine._data[FTP_USERNAME] = ftp['user']
        engine._data[FTP_PASSWORD] = ftp['password']
        engine._data[FTP_UPLOAD_DIR] = ftp['upload_dir']
        engine._data[FTP_MAX_INTEGRITY_RETRIES] = ftp[
            'upload_integrity_retries']
        engine._data[HTTP_DOWNLOAD_URI] = ftp['http_download_uri']
        engine._data[RTMP_SERVER_URI] = ftp['rtmp_server_uri']
コード例 #2
0
ファイル: remoteurls.py プロジェクト: SmallsLIVE/mediadrop
    def save_engine_params(self, engine, **kwargs):
        """Map validated field values to engine data.

        Since form widgets may be nested or named differently than the keys
        in the :attr:`mediadrop.lib.storage.StorageEngine._data` dict, it is
        necessary to manually map field values to the data dictionary.

        :type engine: :class:`mediadrop.lib.storage.StorageEngine` subclass
        :param engine: An instance of the storage engine implementation.
        :param \*\*kwargs: Validated and filtered form values.
        :raises formencode.Invalid: If some post-validation error is detected
            in the user input. This will trigger the same error handling
            behaviour as with the @validate decorator.

        """
        StorageForm.save_engine_params(self, engine, **kwargs)
        rtmp = kwargs.get('rtmp', {})
        rtmp_servers = rtmp.get('known_servers', ())
        engine._data['rtmp_server_uris'] = [x for x in rtmp_servers if x]
コード例 #3
0
ファイル: remoteurls.py プロジェクト: sudheesh001/mediadrop
    def save_engine_params(self, engine, **kwargs):
        """Map validated field values to engine data.

        Since form widgets may be nested or named differently than the keys
        in the :attr:`mediadrop.lib.storage.StorageEngine._data` dict, it is
        necessary to manually map field values to the data dictionary.

        :type engine: :class:`mediadrop.lib.storage.StorageEngine` subclass
        :param engine: An instance of the storage engine implementation.
        :param \*\*kwargs: Validated and filtered form values.
        :raises formencode.Invalid: If some post-validation error is detected
            in the user input. This will trigger the same error handling
            behaviour as with the @validate decorator.

        """
        StorageForm.save_engine_params(self, engine, **kwargs)
        rtmp = kwargs.get('rtmp', {})
        rtmp_servers = rtmp.get('known_servers', ())
        engine._data['rtmp_server_uris'] = [x for x in rtmp_servers if x]
コード例 #4
0
ファイル: ftp.py プロジェクト: GitReadysoft/mediadrop
    def save_engine_params(self, engine, **kwargs):
        """Map validated field values to engine data.

        Since form widgets may be nested or named differently than the keys
        in the :attr:`mediadrop.lib.storage.StorageEngine._data` dict, it is
        necessary to manually map field values to the data dictionary.

        :type engine: :class:`mediadrop.lib.storage.StorageEngine` subclass
        :param engine: An instance of the storage engine implementation.
        :param \*\*kwargs: Validated and filtered form values.
        :raises formencode.Invalid: If some post-validation error is detected
            in the user input. This will trigger the same error handling
            behaviour as with the @validate decorator.

        """
        StorageForm.save_engine_params(self, engine, **kwargs)
        ftp = kwargs["ftp"]
        engine._data[FTP_SERVER] = ftp["server"]
        engine._data[FTP_USERNAME] = ftp["user"]
        engine._data[FTP_PASSWORD] = ftp["password"]
        engine._data[FTP_UPLOAD_DIR] = ftp["upload_dir"]
        engine._data[FTP_MAX_INTEGRITY_RETRIES] = ftp["upload_integrity_retries"]
        engine._data[HTTP_DOWNLOAD_URI] = ftp["http_download_uri"]
        engine._data[RTMP_SERVER_URI] = ftp["rtmp_server_uri"]