1414
1515from dataclasses import dataclass
1616from logging import Logger , LoggerAdapter
17- from typing import Any , Optional , Protocol , TYPE_CHECKING
17+ from typing import Any , Optional , TYPE_CHECKING
1818from sqlalchemy import orm
1919
2020from organizer .database .models import DbFolder
@@ -67,12 +67,16 @@ class OrganizerContext:
6767 """Helper for constructing UI pages"""
6868
6969
70- class MetaPluginInterface ( Protocol ) :
70+ class MetaPluginInterface :
7171 """
72- Protocol defining the metaplugin interface .
72+ Base class for metaplugins .
7373
74- Metaplugins should implement a `Plugin` class with these attributes and methods.
75- All methods are optional - metaplugins only need to implement the hooks they use.
74+ Metaplugins should inherit from this class and override the hooks they need.
75+ All methods have sensible defaults, so you only need to implement what you use.
76+
77+ Required attributes:
78+ PLUGIN_NAME: str - Unique metaplugin identifier (e.g., "my_metaplugin")
79+ PLUGIN_VERSION: str - Metaplugin version string (e.g., "1.0.0")
7680 """
7781
7882 PLUGIN_NAME : str
@@ -96,7 +100,7 @@ async def on_init(self, context: OrganizerContext):
96100 self.log = context.log
97101 self.log.info(f"{self.PLUGIN_NAME} initialized")
98102 """
99- ...
103+ pass
100104
101105 async def on_shutdown (self ) -> None :
102106 """
@@ -108,7 +112,7 @@ async def on_shutdown(self) -> None:
108112 async def on_shutdown(self):
109113 self.log.info(f"{self.PLUGIN_NAME} shutting down")
110114 """
111- ...
115+ pass
112116
113117 def extend_actions (self , actions : dict [str , clap .ActionDef ]) -> dict [str , clap .ActionDef ]:
114118 """
@@ -138,7 +142,7 @@ def extend_actions(self, actions):
138142
139143 return actions
140144 """
141- ...
145+ return actions
142146
143147 async def handle_custom_command (
144148 self , cmd : str , args : dict [str , Any ], session : org .UserSessionData , organizer : "OrganizerInbound"
@@ -173,7 +177,7 @@ async def handle_custom_command(self, cmd, args, session, organizer):
173177
174178 return True
175179 """
176- ...
180+ return False
177181
178182 async def augment_folder_listing (
179183 self , listing_items : list [clap .PageItemFolderListingItem ], folder_context : "FolderContext" , session : org .UserSessionData
@@ -206,7 +210,7 @@ async def augment_folder_listing(self, listing_items, folder_context, session):
206210
207211 return listing_items
208212 """
209- ...
213+ return listing_items
210214
211215 async def augment_listing_data (
212216 self , listing_data : dict [str , str ], folder_context : "FolderContext" , session : org .UserSessionData
@@ -231,7 +235,7 @@ async def augment_listing_data(self, listing_data, folder_context, session):
231235 listing_data["folder_id"] = str(folder_context.folder.id)
232236 return listing_data
233237 """
234- ...
238+ return listing_data
235239
236240 async def check_action_authorization (
237241 self ,
@@ -270,4 +274,4 @@ async def check_action_authorization(self, action, folder, media_file, session):
270274 # Use default checks for everything else
271275 return None
272276 """
273- ...
277+ return None
0 commit comments