eric4-plugininstall.py

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

eric ide

mercurial