eric5_qregularexpression.py

changeset 2736
86cd4d14b58e
child 2791
a9577f248f04
child 2965
d133c7edd88a
equal deleted inserted replaced
2734:eddb1a77f771 2736:86cd4d14b58e
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3
4 # Copyright (c) 2013 Detlev Offenbach <detlev@die-offenbachs.de>
5 #
6
7 """
8 Eric5 QRegularExpression
9
10 This is the main Python script that performs the necessary initialization
11 of the QRegularExpression wizard module and starts the Qt event loop. This is a standalone
12 version of the integrated QRegularExpression wizard.
13 """
14
15 import sys
16
17 for arg in sys.argv:
18 if arg.startswith("--config="):
19 import Globals
20 configDir = arg.replace("--config=", "")
21 Globals.setConfigDir(configDir)
22 sys.argv.remove(arg)
23 break
24
25 from Globals import AppInfo
26
27 from Toolbox import Startup
28
29
30 def createMainWidget(argv):
31 """
32 Function to create the main widget.
33
34 @param argv list of commandline parameters (list of strings)
35 @return reference to the main widget (QWidget)
36 """
37 from Plugins.WizardPlugins.QRegularExpressionWizard.QRegularExpressionWizardDialog \
38 import QRegularExpressionWizardWindow
39 return QRegularExpressionWizardWindow()
40
41
42 def main():
43 """
44 Main entry point into the application.
45 """
46 options = [\
47 ("--config=configDir",
48 "use the given directory as the one containing the config files"),
49 ]
50 appinfo = AppInfo.makeAppInfo(sys.argv,
51 "Eric5 QRegularExpression",
52 "",
53 "Regexp editor for Qt's QRegularExpression class",
54 options)
55 res = Startup.simpleAppStartup(sys.argv,
56 appinfo,
57 createMainWidget)
58 sys.exit(res)
59
60 if __name__ == '__main__':
61 main()

eric ide

mercurial