I can't seem to figure out the syntax for triggering a function upon someone using a FileInput widget in a Parameterized class.
I understand that FileInput isn't a param itself, but I looked at the code for it and the value attribute is a generic param.Parameter, so I thought this would work. I also tried just depending on file (@param.depends('file')
).
class MyFile(param.Parameterized):
file = pn.widgets.FileInput() # should be a param.?
file_data = None
@param.depends('file.value')
def process_file(self):
print('processing file')
self.file_data = self.file.value
my_file = MyFile()
Then after using the file widget, I would expect my_file.file_data
to have the same contents of self.file.value
.
Appreciate any input or if anyone can point me to appropriate docs. Thanks!