eric5-plugininstall.py

changeset 15
f6ccc31d6e72
child 18
3b1f5d872fd7
equal deleted inserted replaced
14:092aa8fafa4e 15:f6ccc31d6e72
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3
4 # Copyright (c) 2007 - 2010 Detlev Offenbach <detlev@die-offenbachs.de>
5 #
6
7 """
8 Eric4 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 import os
15
16 for arg in sys.argv:
17 if arg.startswith("--config="):
18 import Utilities
19 configDir = arg.replace("--config=", "")
20 Utilities.setConfigDir(configDir)
21 sys.argv.remove(arg)
22 break
23
24 from Utilities import Startup
25
26 def createMainWidget(argv):
27 """
28 Function to create the main widget.
29
30 @param argv list of commandline parameters (list of strings)
31 @return reference to the main widget (QWidget)
32 """
33 from PluginManager.PluginInstallDialog import PluginInstallWindow
34 return PluginInstallWindow(argv[1:])
35
36 def main():
37 """
38 Main entry point into the application.
39 """
40 options = [\
41 ("--config=configDir",
42 "use the given directory as the one containing the config files"),
43 ("", "names of plugins to install")
44 ]
45 appinfo = Startup.makeAppInfo(sys.argv,
46 "Eric4 Plugin Installer",
47 "",
48 "Plugin installation utility for eric5",
49 options)
50 res = Startup.simpleAppStartup(sys.argv,
51 appinfo,
52 createMainWidget)
53 sys.exit(res)
54
55 if __name__ == '__main__':
56 main()

eric ide

mercurial