eric5-configure.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) 2006 - 2010 Detlev Offenbach <detlev@die-offenbachs.de>
5 #
6
7 """
8 Eric4 Configure
9
10 This is the main Python script to configure the eric5 IDE from the outside.
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 # make ThirdParty package available as a packages repository
25 try:
26 import pygments
27 except ImportError:
28 sys.path.insert(2, os.path.join(os.path.dirname(__file__), "ThirdParty", "Pygments"))
29
30 from Utilities import Startup
31
32 import Preferences
33
34
35 def createMainWidget(argv):
36 """
37 Function to create the main widget.
38
39 @param argv list of commandline parameters (list of strings)
40 @return reference to the main widget (QWidget)
41 """
42 from Preferences.ConfigurationDialog import ConfigurationWindow
43 w = ConfigurationWindow()
44 w.show()
45 w.showConfigurationPageByName("empty")
46 return w
47
48 def main():
49 """
50 Main entry point into the application.
51 """
52 options = [\
53 ("--config=configDir",
54 "use the given directory as the one containing the config files"),
55 ]
56 appinfo = Startup.makeAppInfo(sys.argv,
57 "Eric4 Configure",
58 "",
59 "Configuration editor for eric5",
60 options)
61 res = Startup.simpleAppStartup(sys.argv,
62 appinfo,
63 createMainWidget)
64 sys.exit(res)
65
66 if __name__ == '__main__':
67 main()

eric ide

mercurial