eric4-diff.py

changeset 0
de9c2efb9d02
child 7
c679fb30c8f3
equal deleted inserted replaced
-1:000000000000 0:de9c2efb9d02
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 # Copyright (c) 2006 - 2009 Detlev Offenbach <detlev@die-offenbachs.de>
5 #
6
7 """
8 Eric4 Diff
9
10 This is the main Python script that performs the necessary initialization
11 of the Diff module and starts the Qt event loop. This is a standalone
12 version of the integrated Diff module.
13 """
14
15 import sys
16 import os
17
18 import sip
19 sip.setapi("QString", 2)
20
21 for arg in sys.argv:
22 if arg.startswith("--config="):
23 import Utilities
24 configDir = arg.replace("--config=", "")
25 Utilities.setConfigDir(configDir)
26 sys.argv.remove(arg)
27 break
28
29 from Utilities import Startup
30
31 def createMainWidget(argv):
32 """
33 Function to create the main widget.
34
35 @param argv list of commandline parameters (list of strings)
36 @return reference to the main widget (QWidget)
37 """
38 from UI.DiffDialog import DiffWindow
39 return DiffWindow()
40
41 def main():
42 """
43 Main entry point into the application.
44 """
45 options = [\
46 ("--config=configDir",
47 "use the given directory as the one containing the config files"),
48 ]
49 appinfo = Startup.makeAppInfo(sys.argv,
50 "Eric4 Diff",
51 "",
52 "Simple graphical diff tool",
53 options)
54 res = Startup.simpleAppStartup(sys.argv,
55 appinfo,
56 createMainWidget)
57 sys.exit(res)
58
59 if __name__ == '__main__':
60 main()

eric ide

mercurial