-
Notifications
You must be signed in to change notification settings - Fork 1
/
getPlugins.py
61 lines (43 loc) · 1.45 KB
/
getPlugins.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
* File Name : getPlugins.py
* Purpose : Example usage of the pluginManager.
* Creation Date : 20-06-2016
* Copyright (c) 2016 Mandeep Singh <[email protected]>
"""
from __future__ import print_function
from pluginManager import PluginManager
# import ipdb
# May also do:
# import pluginManager
# pm = pluginManager.PluginManager()
""" This is an example file to use the pluginManager.py. It have some lines
as comments and their respective description. Uncomment a line to see it in
action. For example, uncomment the line 50 i.e. "# pm.install(plugin)" to
install the plugin.
"""
# Creating instance of PluginManager class.
pm = PluginManager()
# Get all Plugins in form of a list.
# Access individual all_plugins as all_plugins[1]
all_plugins = pm.allPlugins()
# Print a list and the respecive indices of all Plugins by iterating over it.
for index, plugin in enumerate(all_plugins):
print("\n===========")
print(index, plugin.name)
# Select a particular plugin. Let's say a Macro.
plugin = all_plugins[23]
# Get additional information about this plugin.
pm.info(plugin)
# Check if the plugin is installed or not.
print("\nChecking if the plugin is installed: ")
pm.isInstalled(plugin)
# Install a plugin.
# pm.install(plugin)
# Check if the plugin is up-to-date (latest version available).
# pm.isUpToDate(plugin)
# Update a plugin.
# pm.update(plugin)
# Uninstall a plugin.
# pm.uninstall(plugin)