<s> """<STR_LIT>""" <EOL> from pyjamas . ui . FlashPanel import FlashPanel <EOL> import DeferredHandler <EOL> from pyjamas import DOM <EOL> from urllib import quote <EOL> from __pyjamas__ import wnd , JS <EOL> class SWFUploadInstances : <EOL> def addInstance ( self , movieName , instance ) : <EOL> setattr ( self , movieName , instance ) <EOL> class SWFUploadEventCatcher : <EOL> def __init__ ( self ) : <EOL> self . instances = SWFUploadInstances ( ) <EOL> def addInstance ( self , movieName , instance ) : <EOL> self . instances . addInstance ( movieName , instance ) <EOL> wnd ( ) . SWFUpload = SWFUploadEventCatcher ( ) <EOL> def setInstanceGlobal ( movieName , instance ) : <EOL> wnd ( ) . SWFUpload . addInstance ( movieName , instance ) <EOL> global movieCount <EOL> movieCount = <NUM_LIT:0> <EOL> def getMovieCount ( ) : <EOL> return movieCount <EOL> class SWFUpload ( FlashPanel ) : <EOL> """<STR_LIT>""" <EOL> QUEUE_ERROR = { <EOL> '<STR_LIT>' : - <NUM_LIT:100> , <EOL> '<STR_LIT>' : - <NUM_LIT> , <EOL> '<STR_LIT>' : - <NUM_LIT> , <EOL> '<STR_LIT>' : - <NUM_LIT> <EOL> } <EOL> UPLOAD_ERROR = { <EOL> '<STR_LIT>' : - <NUM_LIT:200> , <EOL> '<STR_LIT>' : - <NUM_LIT> , <EOL> '<STR_LIT>' : - <NUM_LIT> , <EOL> '<STR_LIT>' : - <NUM_LIT> , <EOL> '<STR_LIT>' : - <NUM_LIT> , <EOL> '<STR_LIT>' : - <NUM_LIT> , <EOL> '<STR_LIT>' : - <NUM_LIT> , <EOL> '<STR_LIT>' : - <NUM_LIT> , <EOL> '<STR_LIT>' : - <NUM_LIT> , <EOL> '<STR_LIT>' : - <NUM_LIT> <EOL> } <EOL> FILE_STATUS = { <EOL> '<STR_LIT>' : - <NUM_LIT:1> , <EOL> '<STR_LIT>' : - <NUM_LIT:2> , <EOL> '<STR_LIT>' : - <NUM_LIT:3> , <EOL> '<STR_LIT>' : - <NUM_LIT:4> , <EOL> '<STR_LIT>' : - <NUM_LIT:5> <EOL> } <EOL> BUTTON_ACTION = { <EOL> '<STR_LIT>' : - <NUM_LIT:100> , <EOL> '<STR_LIT>' : - <NUM_LIT> , <EOL> '<STR_LIT>' : - <NUM_LIT> <EOL> } <EOL> CURSOR = { <EOL> '<STR_LIT>' : - <NUM_LIT:1> , <EOL> '<STR_LIT>' : - <NUM_LIT:2> <EOL> } <EOL> WINDOW_MODE = { <EOL> '<STR_LIT>' : "<STR_LIT>" , <EOL> '<STR_LIT>' : "<STR_LIT>" , <EOL> '<STR_LIT>' : "<STR_LIT>" <EOL> } <EOL> def __init__ ( self ) : <EOL> FlashPanel . __init__ ( self ) <EOL> global movieCount <EOL> self . settings = None <EOL> self . eventQueue = [ ] <EOL> self . setObjectClass ( '<STR_LIT>' ) <EOL> self . movieName = '<STR_LIT>' + str ( movieCount ) <EOL> movieCount += <NUM_LIT:1> <EOL> self . setObjectID ( self . movieName ) <EOL> self . setWmode ( '<STR_LIT>' ) <EOL> self . setMenu ( False ) <EOL> setInstanceGlobal ( self . movieName , self ) <EOL> def getSettings ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . settings <EOL> def setSettings ( self , settings ) : <EOL> """<STR_LIT>""" <EOL> self . settings = settings <EOL> self . flash_url = self . settings . getFlashURL ( ) <EOL> self . setObjectWidth ( self . settings . getButtonWidth ( ) ) <EOL> self . setObjectHeight ( self . settings . getButtonHeight ( ) ) <EOL> self . flashvars = self . __createFlashVars ( ) <EOL> def __createFlashVars ( self ) : <EOL> httpSuccessString = '<STR_LIT:U+002C>' . join ( self . settings . http_success ) <EOL> paramString = self . __buildParamString ( ) <EOL> vars = [ <EOL> "<STR_LIT>" , quote ( self . object_id ) , <EOL> "<STR_LIT>" , quote ( self . settings . upload_url ) , <EOL> "<STR_LIT>" , quote ( self . settings . use_query_string ) , <EOL> "<STR_LIT>" , quote ( self . settings . requeue_on_error ) , <EOL> "<STR_LIT>" , quote ( httpSuccessString ) , <EOL> "<STR_LIT>" , quote ( self . settings . assume_success_timeout ) , <EOL> "<STR_LIT>" , quote ( paramString ) , <EOL> "<STR_LIT>" , quote ( self . settings . file_post_name ) , <EOL> "<STR_LIT>" , quote ( self . settings . file_types ) , <EOL> "<STR_LIT>" , quote ( self . settings . file_types_description ) , <EOL> "<STR_LIT>" , quote ( self . settings . file_size_limit ) , <EOL> "<STR_LIT>" , quote ( self . settings . file_upload_limit ) , <EOL> "<STR_LIT>" , quote ( self . settings . file_queue_limit ) , <EOL> "<STR_LIT>" , None , <EOL> "<STR_LIT>" , quote ( self . settings . button_image_url ) , <EOL> "<STR_LIT>" , quote ( self . settings . button_width ) , <EOL> "<STR_LIT>" , quote ( self . settings . button_height ) , <EOL> "<STR_LIT>" , quote ( self . settings . button_text ) , <EOL> "<STR_LIT>" , quote ( self . settings . button_text_top_padding ) , <EOL> "<STR_LIT>" , quote ( self . settings . button_text_left_padding ) , <EOL> "<STR_LIT>" , quote ( self . settings . button_text_style ) , <EOL> "<STR_LIT>" , quote ( self . settings . button_action ) , <EOL> "<STR_LIT>" , quote ( self . settings . button_disabled ) , <EOL> "<STR_LIT>" , quote ( self . settings . button_cursor ) <EOL> ] <EOL> return '<STR_LIT>' . join ( vars ) <EOL> def __buildParamString ( self ) : <EOL> postParams = self . settings . post_params <EOL> paramStringPairs = [ ] <EOL> for k , v in postParams : <EOL> paramStringPairs . append ( quote ( k ) + "<STR_LIT:=>" + quote ( v ) ) <EOL> return '<STR_LIT>' . join ( paramStringPairs ) <EOL> def callFlash ( self , functionName , arguments = [ ] ) : <EOL> """<STR_LIT>""" <EOL> returnValue = FlashPanel . callFlash ( self , functionName , arguments ) <EOL> try : <EOL> if str ( returnValue ) == '<STR_LIT>' : <EOL> returnValue = SWFFile ( returnValue ) <EOL> except : <EOL> pass <EOL> return returnValue <EOL> def startUpload ( self , file_id = None ) : <EOL> """<STR_LIT>""" <EOL> if file_id is not None : <EOL> self . callFlash ( '<STR_LIT>' , [ file_id ] ) <EOL> else : <EOL> self . callFlash ( '<STR_LIT>' ) <EOL> def cancelUpload ( self , file_id , triggerErrorEvent = True ) : <EOL> """<STR_LIT>""" <EOL> self . callFlash ( '<STR_LIT>' , [ file_id , triggerErrorEvent ] ) <EOL> def stopUpload ( self ) : <EOL> """<STR_LIT>""" <EOL> self . callFlash ( '<STR_LIT>' ) <EOL> def getFileByIndex ( self , index ) : <EOL> """<STR_LIT>""" <EOL> return self . callFlash ( '<STR_LIT>' , [ index ] ) <EOL> def getFile ( self , file_id ) : <EOL> """<STR_LIT>""" <EOL> return self . callFlash ( '<STR_LIT>' , [ file_id ] ) <EOL> def addFileParam ( self , file_id , name , value ) : <EOL> """<STR_LIT>""" <EOL> self . callFlash ( '<STR_LIT>' , [ file_id , name , value ] ) <EOL> def removeFileParam ( self , file_id , name ) : <EOL> """<STR_LIT>""" <EOL> self . callFlash ( '<STR_LIT>' , [ file_id , name ] ) <EOL> def setUploadURL ( self , url ) : <EOL> """<STR_LIT>""" <EOL> self . callFlash ( '<STR_LIT>' , [ url ] ) <EOL> def setPostParams ( self , paramsDict ) : <EOL> """<STR_LIT>""" <EOL> self . callFlash ( '<STR_LIT>' , [ paramsDict ] ) <EOL> def addPostParam ( self , name , value ) : <EOL> """<STR_LIT>""" <EOL> self . settings . addPostParam ( name , value ) <EOL> self . setPostParams ( self . settings . post_params ) <EOL> def removePostParam ( self , name ) : <EOL> """<STR_LIT>""" <EOL> self . settings . removePostParam ( name ) <EOL> self . setPostParams ( self . settings . post_params ) <EOL> def setFileSizeLimit ( self , fileSizeLimit ) : <EOL> """<STR_LIT>""" <EOL> self . settings . fiel_size_limit = fileSizeLimit <EOL> self . callFlash ( '<STR_LIT>' , [ fileSizeLimit ] ) <EOL> def setFileUploadLimit ( self , fileUploadLimit ) : <EOL> """<STR_LIT>""" <EOL> self . settings . file_upload_limit = fileUploadLimit <EOL> self . callFlash ( '<STR_LIT>' , [ fileUploadLimit ] ) <EOL> def setFileQueueLimit ( self , fileQueueLimit ) : <EOL> """<STR_LIT>""" <EOL> self . settings . file_queue_limit = fileQueueLimit <EOL> self . callFlash ( "<STR_LIT>" , [ fileQueueLimit ] ) <EOL> def setFilePostName ( self , filePostName ) : <EOL> """<STR_LIT>""" <EOL> self . settings . file_post_name = filePostName <EOL> self . callFlash ( "<STR_LIT>" , [ filePostName ] ) <EOL> def setButtonDisabled ( self , isDisabled ) : <EOL> """<STR_LIT>""" <EOL> self . settings . button_disabled = isDisabled <EOL> self . callFlash ( "<STR_LIT>" , [ isDisabled ] ) <EOL> def setButtonAction ( self , buttonAction ) : <EOL> """<STR_LIT>""" <EOL> self . settings . button_action = buttonAction <EOL> self . callFlash ( "<STR_LIT>" , [ buttonAction ] ) <EOL> def setButtonCursor ( self , cursor ) : <EOL> """<STR_LIT>""" <EOL> self . settings . button_cursor = cursor <EOL> self . callFlash ( "<STR_LIT>" , [ cursor ] ) <EOL> def setButtonText ( self , html ) : <EOL> """<STR_LIT>""" <EOL> self . settings . button_text = html <EOL> self . callFlash ( "<STR_LIT>" , [ html ] ) <EOL> def setButtonTextPadding ( self , left , top ) : <EOL> """<STR_LIT>""" <EOL> self . settings . button_text_top_padding = top <EOL> self . settings . button_text_left_padding = left <EOL> self . callFlash ( "<STR_LIT>" , [ left , top ] ) <EOL> def setButtonTextStyle ( self , css ) : <EOL> """<STR_LIT>""" <EOL> self . settings . button_text_style = css <EOL> self . callFlash ( "<STR_LIT>" , [ css ] ) <EOL> def setButtonDimensions ( self , width , height ) : <EOL> """<STR_LIT>""" <EOL> self . settings . button_width = width ; <EOL> self . settings . button_height = height ; <EOL> movie = self . getMovieElement ( ) <EOL> if movie is not None : <EOL> DOM . setStyleAttribute ( movie , '<STR_LIT:width>' , width + '<STR_LIT>' ) <EOL> DOM . setStyleAttribute ( movie , '<STR_LIT>' , height + '<STR_LIT>' ) <EOL> self . callFlash ( "<STR_LIT>" , [ width , height ] ) <EOL> def setButtonImageURL ( self , buttonImageURL ) : <EOL> """<STR_LIT>""" <EOL> self . settings . button_image_url = buttonImageURL <EOL> self . callFlash ( "<STR_LIT>" , [ buttonImageURL ] ) <EOL> def testExternalInterface ( self ) : <EOL> try : <EOL> return self . callFlash ( "<STR_LIT>" ) <EOL> except : <EOL> return False <EOL> def flashReady ( self ) : <EOL> """<STR_LIT>""" <EOL> self . swfUploadLoaded ( ) <EOL> def swfUploadLoaded ( self ) : <EOL> """<STR_LIT>""" <EOL> DeferredHandler . add ( self . settings . swfupload_loaded_handler ) <EOL> def uploadProgress ( self , file , bytesLoaded , totalBytes ) : <EOL> """<STR_LIT>""" <EOL> file = SWFFile ( file ) <EOL> DeferredHandler . add ( self . settings . upload_progress_handler , [ file , bytesLoaded , totalBytes ] ) <EOL> def uploadError ( self , file , errorCode , message ) : <EOL> """<STR_LIT>""" <EOL> file = SWFFile ( file ) <EOL> DeferredHandler . add ( self . settings . upload_error_handler , [ file , errorCode , message ] ) <EOL> def uploadSuccess ( self , file , receivedResponse , serverData ) : <EOL> """<STR_LIT>""" <EOL> file = SWFFile ( file ) <EOL> DeferredHandler . add ( self . settings . upload_success_handler , [ file , receivedResponse , serverData ] ) <EOL> def uploadComplete ( self , file ) : <EOL> """<STR_LIT>""" <EOL> file = SWFFile ( file ) <EOL> DeferredHandler . add ( self . settings . upload_complete_handler , [ file ] ) <EOL> def fileDialogStart ( self ) : <EOL> """<STR_LIT>""" <EOL> DeferredHandler . add ( self . settings . file_dialog_start_handler ) <EOL> def fileQueued ( self , file ) : <EOL> """<STR_LIT>""" <EOL> file = SWFFile ( file ) <EOL> DeferredHandler . add ( self . settings . file_queued_handler , [ file ] ) <EOL> def fileQueueError ( self , file , errorCode , message ) : <EOL> """<STR_LIT>""" <EOL> file = SWFFile ( file ) <EOL> DeferredHandler . add ( self . settings . file_queue_error_handler , [ file , errorCode , message ] ) <EOL> def fileDialogComplete ( self , sel , qu , tqu ) : <EOL> """<STR_LIT>""" <EOL> DeferredHandler . add ( self . settings . file_dialog_complete_handler , [ sel , qu , tqu ] ) <EOL> def uploadStart ( self , file ) : <EOL> """<STR_LIT>""" <EOL> file = SWFFile ( file ) <EOL> status = self . settings . upload_start_handler ( file ) <EOL> self . callFlash ( '<STR_LIT>' , [ status ] ) <EOL> class Settings : <EOL> """<STR_LIT:U+0020>""" <EOL> def __init__ ( self ) : <EOL> self . upload_url = "<STR_LIT>" <EOL> """<STR_LIT>""" <EOL> self . preserve_relative_urls = False <EOL> """<STR_LIT>""" <EOL> self . file_post_name = '<STR_LIT>' <EOL> """<STR_LIT>""" <EOL> self . post_params = { } <EOL> """<STR_LIT>""" <EOL> self . use_query_string = False <EOL> """<STR_LIT>""" <EOL> self . requeue_on_error = False <EOL> """<STR_LIT>""" <EOL> self . http_success = [ ] <EOL> """<STR_LIT>""" <EOL> self . assume_success_timeout = <NUM_LIT:0> <EOL> """<STR_LIT>""" <EOL> self . file_types = '<STR_LIT>' <EOL> """<STR_LIT>""" <EOL> self . file_types_description = '<STR_LIT>' <EOL> """<STR_LIT>""" <EOL> self . file_size_limit = <NUM_LIT:0> <EOL> """<STR_LIT>""" <EOL> self . file_upload_limit = <NUM_LIT:0> <EOL> """<STR_LIT>""" <EOL> self . file_queue_limit = <NUM_LIT:0> <EOL> """<STR_LIT>""" <EOL> self . flash_url = '<STR_LIT>' <EOL> """<STR_LIT>""" <EOL> self . prevent_swf_caching = True <EOL> """<STR_LIT>""" <EOL> self . button_image_url = '<STR_LIT>' <EOL> """<STR_LIT>""" <EOL> self . button_width = <NUM_LIT:1> <EOL> """<STR_LIT>""" <EOL> self . button_height = <NUM_LIT:1> <EOL> """<STR_LIT>""" <EOL> self . button_text = '<STR_LIT>' <EOL> """<STR_LIT>""" <EOL> self . button_text_style = '<STR_LIT>' <EOL> """<STR_LIT>""" <EOL> self . button_text_top_padding = <NUM_LIT:0> <EOL> """<STR_LIT>""" <EOL> self . button_text_left_padding = <NUM_LIT:0> <EOL> """<STR_LIT>""" <EOL> self . button_action = SWFUpload . BUTTON_ACTION [ '<STR_LIT>' ] <EOL> """<STR_LIT>""" <EOL> self . button_disabled = False <EOL> """<STR_LIT>""" <EOL> self . button_cursor = - <NUM_LIT:2> <EOL> """<STR_LIT>""" <EOL> self . button_window_mode = SWFUpload . WINDOW_MODE [ '<STR_LIT>' ] <EOL> """<STR_LIT>""" <EOL> self . return_upload_start_handler = None <EOL> self . swfupload_loaded_handler = None <EOL> self . file_dialog_start_handler = None <EOL> self . file_queued_handler = None <EOL> self . file_queue_error_handler = None <EOL> self . file_dialog_complete_handler = None <EOL> self . upload_start_handler = None <EOL> self . upload_progress_handler = None <EOL> self . upload_error_handler = None <EOL> self . upload_success_handler = None <EOL> self . upload_complete_handler = None <EOL> self . custom_settings = { } <EOL> self . customSettings = self . custom_settings <EOL> if self . prevent_swf_caching : <EOL> pass <EOL> def setURL ( self , url ) : <EOL> """<STR_LIT>""" <EOL> self . upload_url = url <EOL> def getURL ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . upload_url <EOL> def setSuccessTimeout ( self , assume_success_timeout ) : <EOL> """<STR_LIT>""" <EOL> self . assume_success_timeout = assume_success_timeout <EOL> def getSuccessTimeout ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . assume_success_timeout <EOL> def setFilePostName ( self , file_post_name ) : <EOL> """<STR_LIT>""" <EOL> self . file_post_name = file_post_name <EOL> def getFilePostName ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . file_post_name <EOL> def setPostParams ( self , post_params ) : <EOL> """<STR_LIT>""" <EOL> self . post_params = post_params <EOL> def addPostParam ( self , name , value ) : <EOL> """<STR_LIT>""" <EOL> self . post_params [ name ] = value <EOL> def removePostParam ( self , name ) : <EOL> pass <EOL> def getPostParams ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . post_params <EOL> def setPreventSWFCaching ( self , prevent_swf_caching ) : <EOL> """<STR_LIT>""" <EOL> self . prevent_swf_caching = prevent_swf_caching <EOL> def getPreventSWFCaching ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . prevent_swf_caching <EOL> def useQueryString ( self , use_query_string ) : <EOL> """<STR_LIT>""" <EOL> self . use_query_string = use_query_string <EOL> def isUseQueryString ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . use_query_string <EOL> def setRequeueOnError ( self , requeue_on_error ) : <EOL> self . requeue_on_error = requeue_on_error <EOL> def getRequeueOnError ( self ) : <EOL> return self . requeue_on_error <EOL> def setHTTPSuccess ( self , http_success ) : <EOL> """<STR_LIT>""" <EOL> self . http_success = http_success <EOL> def getHTTPSuccess ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . http_success <EOL> def setFileSizeLimit ( self , file_size_limit ) : <EOL> """<STR_LIT>""" <EOL> self . file_size_limit = file_size_limit <EOL> def getFileSizeLimit ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . file_size_limit <EOL> def setFileType ( self , file_types ) : <EOL> """<STR_LIT>""" <EOL> self . file_types = file_types <EOL> def getFileType ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . file_types <EOL> def setFileTypeDescription ( self , file_types_description ) : <EOL> """<STR_LIT>""" <EOL> self . file_types_description = file_types_description <EOL> def getFileTypeDescription ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . file_types_description <EOL> def setFileUploadLimit ( self , file_upload_limit ) : <EOL> """<STR_LIT>""" <EOL> self . file_upload_limit = file_upload_limit <EOL> def getFileUploadLimit ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . file_upload_limit <EOL> def setFileQueueLimit ( self , file_queue_limit ) : <EOL> """<STR_LIT>""" <EOL> self . file_queue_limit = file_queue_limit <EOL> def getFileQueueLimit ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . file_queue_limit <EOL> def setButtonImageURL ( self , button_image_url ) : <EOL> """<STR_LIT>""" <EOL> self . button_image_url = button_image_url <EOL> def getButtonImageURL ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . button_image_url <EOL> def setButtonWidth ( self , button_width ) : <EOL> """<STR_LIT>""" <EOL> self . button_width = button_width <EOL> def getButtonWidth ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . button_width <EOL> def setButtonHeight ( self , button_height ) : <EOL> """<STR_LIT>""" <EOL> self . button_height = button_height <EOL> def getButtonHeight ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . button_height <EOL> def setButtonAction ( self , button_action ) : <EOL> """<STR_LIT>""" <EOL> self . button_action = button_action <EOL> def getButtonAction ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . button_action <EOL> def setButtonHTML ( self , button_text ) : <EOL> """<STR_LIT>""" <EOL> self . button_text = button_text <EOL> def getButtonHTML ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . button_text <EOL> def setButtonCSS ( self , button_text_style ) : <EOL> """<STR_LIT>""" <EOL> self . button_text_style = button_text_style <EOL> def getButtonCSS ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . button_text_style <EOL> def setButtonTopPadding ( self , button_text_top_padding ) : <EOL> """<STR_LIT>""" <EOL> self . button_text_top_padding = button_text_top_padding <EOL> def getButtonTopPadding ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . button_text_top_padding <EOL> def setButtonLeftPadding ( self , button_text_left_padding ) : <EOL> """<STR_LIT>""" <EOL> self . button_text_left_padding = button_text_left_padding <EOL> def getButtonLeftPadding ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . button_text_left_padding <EOL> def setFlashURL ( self , flash_url ) : <EOL> """<STR_LIT>""" <EOL> self . flash_url = flash_url <EOL> def getFlashURL ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . flash_url <EOL> def setEventListener ( self , listener ) : <EOL> """<STR_LIT>""" <EOL> self . swfupload_loaded_handler = getattr ( listener , '<STR_LIT>' ) <EOL> self . upload_progress_handler = getattr ( listener , '<STR_LIT>' ) <EOL> self . upload_error_handler = getattr ( listener , '<STR_LIT>' ) <EOL> self . upload_success_handler = getattr ( listener , '<STR_LIT>' ) <EOL> self . upload_complete_handler = getattr ( listener , '<STR_LIT>' ) <EOL> self . file_dialog_start_handler = getattr ( listener , '<STR_LIT>' ) <EOL> self . file_queued_handler = getattr ( listener , '<STR_LIT>' ) <EOL> self . file_queue_error_handler = getattr ( listener , '<STR_LIT>' ) <EOL> self . file_dialog_complete_handler = getattr ( listener , '<STR_LIT>' ) <EOL> self . upload_start_handler = getattr ( listener , '<STR_LIT>' ) <EOL> class SWFFile : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , file ) : <EOL> name = None <EOL> JS ( """<STR_LIT>""" ) <EOL> self . id = file . id <EOL> """<STR_LIT>""" <EOL> if name : <EOL> self . name = name <EOL> """<STR_LIT>""" <EOL> self . creationdate = file . creationdate <EOL> """<STR_LIT>""" <EOL> self . modificationdate = file . modificationdate <EOL> """<STR_LIT>""" <EOL> self . type = file . type <EOL> """<STR_LIT>""" <EOL> self . index = file . index <EOL> """<STR_LIT>""" <EOL> self . filestatus = file . filestatus <EOL> """<STR_LIT>""" <EOL> self . size = file . size <EOL> """<STR_LIT>""" <EOL> def getId ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . id <EOL> def getName ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . name <EOL> def getCreationdate ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . creationdate <EOL> def getModificationdate ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . modificationdate <EOL> def getType ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . type <EOL> def getIndex ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . index <EOL> def getFilestatus ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . filestatus <EOL> def getSize ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . size <EOL> class SWFUploadInterface : <EOL> """<STR_LIT>""" <EOL> def swfUploadLoaded ( self ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def uploadProgress ( self , file , bytesLoaded , totalBytes ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def uploadError ( self , file , errorCode , message ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def uploadSuccess ( self , file , receivedResponse , serverData ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def uploadComplete ( self , file ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def fileDialogStart ( self ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def fileQueued ( self , file ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def fileQueueError ( self , file , errorCode , message ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def fileDialogComplete ( self , sel , qu , tqu ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def uploadStart ( self , file ) : <EOL> """<STR_LIT>""" <EOL> return True </s>
