FileReaderWidget

class visualife.widget.FileReaderWidget(drop_zone_id, extensions=[], hint_message='Drop a file')

Bases: object

Reads a file that has been dropped in a browser window

Attributes Summary

actions List of functions which will be run after reading a file
extensions Extensions allowed for a FileReader to read
hint_message Message that is displayed in the drop_zone

Methods Summary

add_action(action) Adds a function to an actions list

Attributes Documentation

actions

List of functions which will be run after reading a file

This function takes whole file text as an argument. File name can be accesed inside this function by kwargs[“key”]

extensions

Extensions allowed for a FileReader to read

hint_message

Message that is displayed in the drop_zone

Methods Documentation

add_action(action)

Adds a function to an actions list