feat: add check plugin dir and docstrings

This commit is contained in:
0xMRTT 2022-09-07 18:16:44 +02:00
parent 3f5f479ed5
commit f1b812ce1c
No known key found for this signature in database
GPG key ID: AC9E06BF3DECB6FB

View file

@ -31,9 +31,12 @@ USER_PLUGIN_DIR = os.path.join(
class GradiencePluginsList:
""" Represent the plugin group in Advanced"""
def __init__(self, win):
self.win = win
self.check_if_plugin_dir_exists()
self.pm = PluginManager()
@ -47,6 +50,14 @@ class GradiencePluginsList:
for pluginInfo in self.pm.getAllPlugins():
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):
group = Adw.PreferencesGroup()