Package muntjac :: Package terminal :: Package gwt :: Package server :: Module streaming_events
[hide private]
[frames] | no frames]

Source Code for Module muntjac.terminal.gwt.server.streaming_events

 1  # Copyright (C) 2012 Vaadin Ltd.  
 2  # Copyright (C) 2012 Richard Lincoln 
 3  #  
 4  # Licensed under the Apache License, Version 2.0 (the "License");  
 5  # you may not use this file except in compliance with the License.  
 6  # You may obtain a copy of the License at  
 7  #  
 8  #     http://www.apache.org/licenses/LICENSE-2.0  
 9  #  
10  # Unless required by applicable law or agreed to in writing, software  
11  # distributed under the License is distributed on an "AS IS" BASIS,  
12  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
13  # See the License for the specific language governing permissions and  
14  # limitations under the License. 
15   
16  from muntjac.terminal.stream_variable import \ 
17      IStreamingEndEvent, IStreamingErrorEvent, IStreamingProgressEvent, \ 
18      IStreamingStartEvent 
19   
20  from muntjac.terminal.gwt.server.abstract_streaming_event import \ 
21      AbstractStreamingEvent 
22   
23   
24 -class StreamingEndEventImpl(AbstractStreamingEvent, IStreamingEndEvent):
25
26 - def __init__(self, filename, typ, totalBytes):
27 super(StreamingEndEventImpl, self).__init__(filename, typ, totalBytes, 28 totalBytes)
29 30
31 -class StreamingErrorEventImpl(AbstractStreamingEvent, IStreamingErrorEvent):
32
33 - def __init__(self, filename, typ, contentLength, bytesReceived, exception):
34 super(StreamingErrorEventImpl, self).__init__(filename, typ, 35 contentLength, bytesReceived) 36 self._exception = exception
37 38
39 - def getException(self):
40 return self._exception
41 42
43 -class StreamingProgressEventImpl(AbstractStreamingEvent, 44 IStreamingProgressEvent):
45
46 - def __init__(self, filename, typ, contentLength, bytesReceived):
47 super(StreamingProgressEventImpl, self).__init__(filename, typ, 48 contentLength, bytesReceived)
49 50
51 -class StreamingStartEventImpl(AbstractStreamingEvent, IStreamingStartEvent):
52
53 - def __init__(self, filename, typ, contentLength):
54 super(StreamingStartEventImpl, self).__init__(filename, typ, 55 contentLength, 0) 56 self._disposed = None
57 58
59 - def disposeStreamVariable(self):
60 self._disposed = True
61 62
63 - def isDisposed(self):
64 return self._disposed
65