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 Installer |
|
9 |
|
10 This is the main Python script to install 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.PluginInstallDialog import PluginInstallWindow |
|
33 return PluginInstallWindow(argv[1:]) |
|
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 ("", "names of plugins to install") |
|
43 ] |
|
44 appinfo = Startup.makeAppInfo(sys.argv, |
|
45 "Eric5 Plugin Installer", |
|
46 "", |
|
47 "Plugin installation utility for eric5", |
|
48 options) |
|
49 res = Startup.simpleAppStartup(sys.argv, |
|
50 appinfo, |
|
51 createMainWidget) |
|
52 sys.exit(res) |
|
53 |
|
54 if __name__ == '__main__': |
|
55 main() |
|