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 committed Nov 19, 2023
1 parent 8aa7d66 commit 7094c9b
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 7094c9b

Please sign in to comment.