Skip to content

Commit 4ae2717

Browse files
egormknmariobuikhuizen
authored andcommitted
fix: add deprecation warnings for accept and directory
1 parent 3d93213 commit 4ae2717

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

ipyvuetify/extra/file_input.py

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -330,14 +330,29 @@ def __init__(self, *args, **kwargs):
330330
if kernel.implementation == "ipython":
331331
nest_asyncio.apply()
332332

333-
# @property
334-
# def file_info(self):
335-
# warnings.warn("file_info is deprecated, use v_model instead", DeprecationWarning)
336-
# return self.v_model
337-
338-
# @file_info.setter
339-
# def file_info(self, _):
340-
# warnings.warn("file_info is deprecated and cannot be set on FileInput")
333+
@property
334+
def accept(self):
335+
warnings.warn("accept is deprecated, use attributes dictionary instead", DeprecationWarning)
336+
if "accept" in self.attributes:
337+
return self.attributes["accept"]
338+
return ""
339+
340+
@accept.setter
341+
def accept(self, value):
342+
warnings.warn("accept is deprecated, use attributes dictionary instead", DeprecationWarning)
343+
self.attributes = {**self.attributes, "accept": value}
344+
345+
@property
346+
def directory(self):
347+
warnings.warn("directory is deprecated, use attributes dictionary instead", DeprecationWarning)
348+
if "directory" in self.attributes:
349+
return self.attributes["directory"]
350+
return False
351+
352+
@directory.setter
353+
def directory(self, value):
354+
warnings.warn("directory is deprecated, use attributes dictionary instead", DeprecationWarning)
355+
self.attributes = {**self.attributes, "directory": value}
341356

342357
@property
343358
def show_progress(self):

0 commit comments

Comments
 (0)