File: synopsis-qt

package info (click to toggle)
synopsis 0.8.0-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 10,112 kB
  • ctags: 12,996
  • sloc: cpp: 34,254; ansic: 33,620; python: 10,975; sh: 7,261; xml: 6,369; makefile: 773; asm: 445
file content (44 lines) | stat: -rwxr-xr-x 1,230 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python
# Qt GUI for Synopsis
# Copyright (c) 2001 by Stephen Davies
#
# Tested on Debian unstable with python2.2-qt3 package (and dependencies)
# You may need to add asgard.debian.org to your sources.list.
# Qt 2.0 uses a different API in places and is NOT supported

from Synopsis.UI.Qt.main import *
from Synopsis.Formatter import ASCII
from Synopsis.Core import Project

if __name__ == "__main__":
    # This is usually set in ASCII's parse_args function.. but we can set it to
    # something more appropriate
    ASCII.comment_str = '<font color="purple">// %s</font>\n'

    app = QApplication(sys.argv)
    app.setDesktopSettingsAware(1) # doesnt work with Qt 2
    # So I prefer the windows style to motif.. shoot me :)
    #app.setStyle(QWindowsStyle())
    #app.setStyle(QPlatinumStyle())
    app.setFont(QFont('Helvetica', 10))

    # Parse args
    load_file = None
    for arg in sys.argv[1:]:
	if arg and arg[0] != '-':
	    load_file = arg

    # Load files
    ast = None
    main = MainWindow()
    app.setMainWidget(main)
    main.show()

    if load_file:
	if Project.is_project_file(load_file):
	    main.do_open_project(load_file)
	else:
	    main.do_open_file(load_file)

    app.exec_loop()