Skip to content

Commit

Permalink
fix: add deprecation warnings for accept and directory
Browse files Browse the repository at this point in the history
  • Loading branch information
egormkn authored and mariobuikhuizen committed Nov 23, 2023
1 parent 3d93213 commit 4ae2717
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions ipyvuetify/extra/file_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,14 +330,29 @@ def __init__(self, *args, **kwargs):
if kernel.implementation == "ipython":
nest_asyncio.apply()

# @property
# def file_info(self):
# warnings.warn("file_info is deprecated, use v_model instead", DeprecationWarning)
# return self.v_model

# @file_info.setter
# def file_info(self, _):
# warnings.warn("file_info is deprecated and cannot be set on FileInput")
@property
def accept(self):
warnings.warn("accept is deprecated, use attributes dictionary instead", DeprecationWarning)
if "accept" in self.attributes:
return self.attributes["accept"]
return ""

@accept.setter
def accept(self, value):
warnings.warn("accept is deprecated, use attributes dictionary instead", DeprecationWarning)
self.attributes = {**self.attributes, "accept": value}

@property
def directory(self):
warnings.warn("directory is deprecated, use attributes dictionary instead", DeprecationWarning)
if "directory" in self.attributes:
return self.attributes["directory"]
return False

@directory.setter
def directory(self, value):
warnings.warn("directory is deprecated, use attributes dictionary instead", DeprecationWarning)
self.attributes = {**self.attributes, "directory": value}

@property
def show_progress(self):
Expand Down

0 comments on commit 4ae2717

Please sign in to comment.