eric5-tray.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 Tray
9
10 This is the main Python script that performs the necessary initialization
11 of the system-tray application. This acts as a quickstarter by providing a
12 context menu to start the eric5 IDE and the eric5 tools.
13 """
14
15 import sys
16 import os
17
18 for arg in sys.argv:
19 if arg.startswith("--config="):
20 import Utilities
21 configDir = arg.replace("--config=", "")
22 Utilities.setConfigDir(configDir)
23 sys.argv.remove(arg)
24 break
25
26 from Utilities import Startup
27
28 def createMainWidget(argv):
29 """
30 Function to create the main widget.
31
32 @param argv list of commandline parameters (list of strings)
33 @return reference to the main widget (QWidget)
34 """
35 from Tools.TrayStarter import TrayStarter
36 return TrayStarter()
37
38 def main():
39 """
40 Main entry point into the application.
41 """
42 options = [\
43 ("--config=configDir",
44 "use the given directory as the one containing the config files"),
45 ]
46 appinfo = Startup.makeAppInfo(sys.argv,
47 "Eric4 Tray",
48 "",
49 "Traystarter for eric5",
50 options)
51 res = Startup.simpleAppStartup(sys.argv,
52 appinfo,
53 createMainWidget,
54 quitOnLastWindowClosed = False)
55 sys.exit(res)
56
57 if __name__ == '__main__':
58 main()

eric ide

mercurial