eric5_qregexp.py

changeset 896
f855351d5e98
parent 791
9ec2ac20e54e
child 945
8cd4d08fa9f6
child 1510
e75ecf2bd9dd
equal deleted inserted replaced
894:eab7b8d39807 896:f855351d5e98
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3
4 # Copyright (c) 2004 - 2011 Detlev Offenbach <detlev@die-offenbachs.de>
5 #
6
7 """
8 Eric5 QRegExp
9
10 This is the main Python script that performs the necessary initialization
11 of the QRegExp wizard module and starts the Qt event loop. This is a standalone
12 version of the integrated QRegExp wizard.
13 """
14
15 import sys
16
17 for arg in sys.argv:
18 if arg.startswith("--config="):
19 import Utilities
20 configDir = arg.replace("--config=", "")
21 Utilities.setConfigDir(configDir)
22 sys.argv.remove(arg)
23 break
24
25 from Utilities import Startup
26
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 Plugins.WizardPlugins.QRegExpWizard.QRegExpWizardDialog import \
36 QRegExpWizardWindow
37 return QRegExpWizardWindow()
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 ]
47 appinfo = Startup.makeAppInfo(sys.argv,
48 "Eric5 QRegExp",
49 "",
50 "Regexp editor for Qt's QRegExp class",
51 options)
52 res = Startup.simpleAppStartup(sys.argv,
53 appinfo,
54 createMainWidget)
55 sys.exit(res)
56
57 if __name__ == '__main__':
58 main()

eric ide

mercurial