Package muntjac :: Package ui :: Module upload :: Class InnerStreamVariable
[hide private]
[frames] | no frames]

Class InnerStreamVariable

source code

                              object --+    
                                       |    
terminal.stream_variable.IStreamVariable --+
                                           |
                                          InnerStreamVariable

Instance Methods [hide private]
 
__init__(self, upload)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
listenProgress(self)
Whether the onProgress method should be called during the upload.
source code
 
onProgress(self, event)
This method is called by the terminal if listenProgress returns true when the streaming starts.
source code
 
isInterrupted(self)
If this method returns true while the content is being streamed the Terminal to stop receiving current upload.
source code
 
getOutputStream(self)
Invoked by the terminal when a new upload arrives, after streamingStarted method has been called.
source code
 
streamingStarted(self, event) source code
 
streamingFinished(self, event) source code
 
streamingFailed(self, event) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, upload)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

listenProgress(self)

source code 

Whether the onProgress method should be called during the upload.

onProgress is called in a synchronized block when the content is being received. This is potentially bit slow, so we are calling that method only if requested. The value is requested after the uploadStarted event, but not after reading each buffer.

Returns:
true if this IStreamVariable wants to by notified during the upload of the progress of streaming.
Overrides: terminal.stream_variable.IStreamVariable.listenProgress
(inherited documentation)

onProgress(self, event)

source code 

This method is called by the terminal if listenProgress returns true when the streaming starts.

Overrides: terminal.stream_variable.IStreamVariable.onProgress
(inherited documentation)

isInterrupted(self)

source code 

If this method returns true while the content is being streamed the Terminal to stop receiving current upload.

Note, the usage of this method is not synchronized over the Application instance by the terminal like other methods. The implementation should only return a boolean field and especially not modify UI or implement a synchronization by itself.

Returns:
true if the streaming should be interrupted as soon as possible.
Overrides: terminal.stream_variable.IStreamVariable.isInterrupted
(inherited documentation)

getOutputStream(self)

source code 

Invoked by the terminal when a new upload arrives, after streamingStarted method has been called. The terminal implementation will write the streamed variable to the returned output stream.

Returns:
Stream to which the uploaded file should be written.
Overrides: terminal.stream_variable.IStreamVariable.getOutputStream
(inherited documentation)

streamingStarted(self, event)

source code 
Overrides: terminal.stream_variable.IStreamVariable.streamingStarted

streamingFinished(self, event)

source code 
Overrides: terminal.stream_variable.IStreamVariable.streamingFinished

streamingFailed(self, event)

source code 
Overrides: terminal.stream_variable.IStreamVariable.streamingFailed