Skip to content

Commit

Permalink
docs(file_upload): update docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Mar 21, 2024
1 parent 527a40c commit 817d835
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions trame/app/file_upload.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
class ClientFile:
"""
Helper class that make it easier to handle file from the trame state
This class behave like a decorator to the state variable so you can easily access its various properties and content.
"""

def __init__(self, file_state_variable=None):
"""Pass the state variable you want to decorate as arg"""
self._name = None
self._size = None
self._time = None
Expand Down Expand Up @@ -46,4 +53,5 @@ def content(self):

@property
def info(self):
"""Return a string summarizing the file information"""
return f"File: {self.name} of size {self.size} and type {self.mime_type}"

0 comments on commit 817d835

Please sign in to comment.