eric5-re.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) 2004 - 2010 Detlev Offenbach <detlev@die-offenbachs.de>
5 #
6
7 """
8 Eric4 Re
9
10 This is the main Python script that performs the necessary initialization
11 of the PyRegExp wizard module and starts the Qt event loop. This is a standalone
12 version of the integrated PyRegExp wizard.
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
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 Plugins.WizardPlugins.PyRegExpWizard.PyRegExpWizardDialog import \
37 PyRegExpWizardWindow
38 return PyRegExpWizardWindow()
39
40 def main():
41 """
42 Main entry point into the application.
43 """
44 options = [\
45 ("--config=configDir",
46 "use the given directory as the one containing the config files"),
47 ]
48 appinfo = Startup.makeAppInfo(sys.argv,
49 "Eric4 RE",
50 "",
51 "Regexp editor for the Python re module",
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