From 7094c9b2b2f6166996b4f0d7352f3ccb1b1bfaaf Mon Sep 17 00:00:00 2001 From: Egor Makarenko Date: Sun, 19 Nov 2023 13:59:33 +0500 Subject: [PATCH] fix: add deprecation warnings for accept and directory --- ipyvuetify/extra/file_input.py | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/ipyvuetify/extra/file_input.py b/ipyvuetify/extra/file_input.py index f76a41de..bc9c7ad1 100644 --- a/ipyvuetify/extra/file_input.py +++ b/ipyvuetify/extra/file_input.py @@ -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):