~ubuntu-branches/ubuntu/karmic/eric/karmic

« back to all changes in this revision

Viewing changes to eric/eric4-diff.py

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2008-01-28 18:02:25 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080128180225-6nrox6yrworh2c4v
Tags: 4.0.4-1ubuntu1
* Add python-qt3 to build-depends becuase that's where Ubuntu puts 
  pyqtconfig
* Change maintainer to MOTU

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
# -*- coding: utf-8 -*-
 
3
 
 
4
# Copyright (c) 2006 - 2007 Detlev Offenbach <detlev@die-offenbachs.de>
 
5
#
 
6
 
 
7
"""
 
8
Eric4 Diff
 
9
 
 
10
This is the main Python script that performs the neccessary 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
 
 
17
if "--nokde" in sys.argv:
 
18
    del sys.argv[sys.argv.index("--nokde")]
 
19
    os.environ["e4nokde"] = "1"
 
20
 
 
21
from Utilities import Startup
 
22
 
 
23
 
 
24
def createMainWidget(argv, qtDir):
 
25
    """
 
26
    Function to create the main widget.
 
27
    
 
28
    @param argv list of commandline parameters (list of strings)
 
29
    @param qtDir directory of the Qt installation (string)
 
30
    @return reference to the main widget (QWidget)
 
31
    """
 
32
    from UI.DiffDialog import DiffDialog
 
33
    return DiffDialog()
 
34
 
 
35
def main():
 
36
    """
 
37
    Main entry point into the application.
 
38
    """
 
39
    options = [\
 
40
        ("--nokde" , "don't use KDE widgets"),
 
41
    ]
 
42
    appinfo = Startup.makeAppInfo(sys.argv,
 
43
                                  "Eric4 Diff",
 
44
                                  "",
 
45
                                  "Simple graphical diff tool",
 
46
                                  options)
 
47
    res = Startup.simpleAppStartup(sys.argv,
 
48
                                   appinfo,
 
49
                                   createMainWidget)
 
50
    sys.exit(res)
 
51
 
 
52
if __name__ == '__main__':
 
53
    main()