mirror of
https://github.com/GradienceTeam/Gradience.git
synced 2024-09-14 00:22:32 +00:00
feat: add check plugin dir and docstrings
This commit is contained in:
parent
3f5f479ed5
commit
f1b812ce1c
1 changed files with 11 additions and 0 deletions
|
@ -31,10 +31,13 @@ USER_PLUGIN_DIR = os.path.join(
|
||||||
|
|
||||||
|
|
||||||
class GradiencePluginsList:
|
class GradiencePluginsList:
|
||||||
|
""" Represent the plugin group in Advanced"""
|
||||||
def __init__(self, win):
|
def __init__(self, win):
|
||||||
|
|
||||||
self.win = win
|
self.win = win
|
||||||
|
|
||||||
|
self.check_if_plugin_dir_exists()
|
||||||
|
|
||||||
self.pm = PluginManager()
|
self.pm = PluginManager()
|
||||||
|
|
||||||
self.pm.setPluginPlaces(
|
self.pm.setPluginPlaces(
|
||||||
|
@ -48,6 +51,14 @@ class GradiencePluginsList:
|
||||||
for pluginInfo in self.pm.getAllPlugins():
|
for pluginInfo in self.pm.getAllPlugins():
|
||||||
pluginInfo.plugin_object.activate()
|
pluginInfo.plugin_object.activate()
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def check_if_plugin_dir_exists():
|
||||||
|
""" Check if the plugin directory exists, if not, create it """
|
||||||
|
if not os.path.exists(USER_PLUGIN_DIR):
|
||||||
|
os.makedirs(USER_PLUGIN_DIR)
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
def to_group(self):
|
def to_group(self):
|
||||||
group = Adw.PreferencesGroup()
|
group = Adw.PreferencesGroup()
|
||||||
group.set_title(_("Plugins"))
|
group.set_title(_("Plugins"))
|
||||||
|
|
Loading…
Reference in a new issue