44from abc import ABC
55from abc import abstractmethod
66from typing import Any
7- import pandas as pd
7+
88import dash_ag_grid as dag
99import dash_bootstrap_components as dbc
1010import ibis
1111from dash import callback
1212from dash import callback_context as ctx
1313from dash import html
1414from dash .dependencies import Input
15- from dash .dependencies import State
1615from dash .dependencies import Output
16+ from dash .dependencies import State
1717from dash .exceptions import PreventUpdate
1818from eimerdb import EimerDBInstance
1919
@@ -181,23 +181,22 @@ def kontroller_show_selected_controls(skjema: str, *args: Any):
181181 f"valgt partisjon: { partition_args } \n valgt skjema: { skjema } "
182182 )
183183 return valgte_vars
184-
184+
185185 @callback (
186186 Output ("alert_store" , "data" , allow_duplicate = True ),
187187 Input (f"{ self .module_number } -kontroll-run-button" , "n_clicks" ),
188188 State ("alert_store" , "data" ),
189- prevent_initial_call = True
189+ prevent_initial_call = True ,
190190 )
191191 def alert_user_of_controls (click , alert_store ):
192192 return [
193- create_alert (
194- "Kjører kontroller, dette kan ta litt tid, du får beskjed når den er ferdig. Ikke klikk på knappen igjen." ,
195- "info" ,
196- ephemeral = True ,
197- ),
198- * alert_store ,
199- ]
200-
193+ create_alert (
194+ "Kjører kontroller, dette kan ta litt tid, du får beskjed når den er ferdig. Ikke klikk på knappen igjen." ,
195+ "info" ,
196+ ephemeral = True ,
197+ ),
198+ * alert_store ,
199+ ]
201200
202201 @callback (
203202 Output (f"{ self .module_number } -kontroller" , "rowData" ),
@@ -208,7 +207,7 @@ def alert_user_of_controls(click, alert_store):
208207 Input (f"{ self .module_number } -kontroll-run-button" , "n_clicks" ),
209208 State ("alert_store" , "data" ),
210209 * self .variableselector .get_all_inputs (),
211- prevent_initial_call = True
210+ prevent_initial_call = True ,
212211 )
213212 def get_kontroller_overview (
214213 skjema : str , refresh : int | None , rerun : int | None , alert_store , * args : Any
@@ -237,7 +236,10 @@ def get_kontroller_overview(
237236 control_class_instance .register_all_controls ()
238237 control_class_instance .execute_controls ()
239238 except ValueError as e :
240- if str (e ) == "No control methods found. Remember to use the 'register_control' decorator function." :
239+ if (
240+ str (e )
241+ == "No control methods found. Remember to use the 'register_control' decorator function."
242+ ):
241243 logger .info ("No control methods found." )
242244 alert_store = [
243245 create_alert (
@@ -330,9 +332,7 @@ def get_kontroller_overview(
330332 ]
331333 columns [0 ]["checkboxSelection" ] = True
332334 columns [0 ]["headerCheckboxSelection" ] = True
333- if (
334- ctx .triggered_id == f"{ self .module_number } -kontroll-run-button"
335- ):
335+ if ctx .triggered_id == f"{ self .module_number } -kontroll-run-button" :
336336 alert_store = [
337337 create_alert (
338338 f"Kontrollkjøring ferdig for kontroller i { control_class_instance .__class__ .__name__ } " ,
0 commit comments