@@ -40,9 +40,48 @@ def __init__(self):
4040
4141 self ._log = ""
4242
43+ def delete_baskets (
44+ self , baskets : str , configuration : Ili2DbCommandConfiguration = None
45+ ):
46+ """
47+ :param baskets: Semicolon-separated list of baskets to be deleted
48+ :param configuration: Base Ili2DbCommandConfiguration object
49+ :return: Tuple with boolean result and optional message
50+ """
51+ deleter = ilideleter .Deleter ()
52+ deleter .tool = configuration .tool
53+ deleter .configuration = DeleteConfiguration (configuration )
54+ deleter .configuration .baskets = baskets
55+
56+ with OverrideCursor (Qt .WaitCursor ):
57+ self ._connect_ili_executable_signals (deleter )
58+ self ._log = ""
59+
60+ res = True
61+ msg = self .tr ("Basket(s) '{}' successfully deleted!" ).format (baskets )
62+ try :
63+ if deleter .run () != ilideleter .Deleter .SUCCESS :
64+ msg = self .tr (
65+ "An error occurred when deleting the basket(s) '{}' from the DB (check the QGIS log panel)."
66+ ).format (baskets )
67+ res = False
68+ self .log_on_error .emit (self ._log )
69+ except JavaNotFoundError as e :
70+ msg = e .error_string
71+ res = False
72+
73+ self ._disconnect_ili_executable_signals (deleter )
74+
75+ return res , msg
76+
4377 def delete_dataset (
4478 self , dataset : str , configuration : Ili2DbCommandConfiguration = None
4579 ):
80+ """
81+ :param dataset: Dataset id to be deleted
82+ :param configuration: Base Ili2DbCommandConfiguration object
83+ :return: Tuple with boolean result and optional message
84+ """
4685 deleter = ilideleter .Deleter ()
4786 deleter .tool = configuration .tool
4887 deleter .configuration = DeleteConfiguration (configuration )
0 commit comments