|
1 #!/usr/bin/env python3 |
|
2 # -*- coding: utf-8 -*- |
|
3 |
|
4 # Copyright (c) 2007 - 2011 Detlev Offenbach <detlev@die-offenbachs.de> |
|
5 # |
|
6 |
|
7 """ |
|
8 Eric5 Plugin Uninstaller |
|
9 |
|
10 This is the main Python script to uninstall eric5 plugins from outside of the IDE. |
|
11 """ |
|
12 |
|
13 import sys |
|
14 |
|
15 for arg in sys.argv: |
|
16 if arg.startswith("--config="): |
|
17 import Utilities |
|
18 configDir = arg.replace("--config=", "") |
|
19 Utilities.setConfigDir(configDir) |
|
20 sys.argv.remove(arg) |
|
21 break |
|
22 |
|
23 from Utilities import Startup |
|
24 |
|
25 def createMainWidget(argv): |
|
26 """ |
|
27 Function to create the main widget. |
|
28 |
|
29 @param argv list of commandline parameters (list of strings) |
|
30 @return reference to the main widget (QWidget) |
|
31 """ |
|
32 from PluginManager.PluginUninstallDialog import PluginUninstallWindow |
|
33 return PluginUninstallWindow() |
|
34 |
|
35 def main(): |
|
36 """ |
|
37 Main entry point into the application. |
|
38 """ |
|
39 options = [\ |
|
40 ("--config=configDir", |
|
41 "use the given directory as the one containing the config files"), |
|
42 ] |
|
43 appinfo = Startup.makeAppInfo(sys.argv, |
|
44 "Eric5 Plugin Uninstaller", |
|
45 "", |
|
46 "Plugin uninstallation utility for eric5", |
|
47 options) |
|
48 res = Startup.simpleAppStartup(sys.argv, |
|
49 appinfo, |
|
50 createMainWidget) |
|
51 sys.exit(res) |
|
52 |
|
53 if __name__ == '__main__': |
|
54 main() |