2 # vi: set syntax=python : */
10 #rox.setup_app_options('Dome')
12 from rox
.Menu
import Menu
, set_save_name
18 # Ugly hack to stop wierd chars appearing...
20 #xml.dom.html.HTML_CHARACTER_ENTITIES = {}
23 from os
.path
import dirname
25 app_dir
= dirname(sys
.argv
[0])
27 from rox
import g
, mime
28 from rox
.options
import Option
29 from Window
import Window
30 rox
.setup_app_options('Dome')
32 default_font
= Option('default_font', 'sans 12')
34 # All options must be registered by the time we get here
35 rox
.app_options
.notify()
37 #sys.argv.append('--disable-crash-dialog')
41 mime
.install_mime_info('Dome')
44 while len(sys
.argv
) > 1 and sys
.argv
[1].startswith('--'):
45 option
= sys
.argv
[1][2:]
48 mono
= 1 # Black & White
52 raise Exception("Unknown option", option
)
57 del sys
.argv
[1:] # GnomeCanvas can't cope with -
58 win
= apply(Window
, files
)
65 `
[]`
# Load repr stuff
66 from Ft
.Xml
.XPath
import XPathParser
# Load XPath stuff
67 XPathParser
.new().parse('/')
68 import urllib2
, urllib
69 r
= urllib2
.Request('http://www.ecs.soton.ac.uk') # HTTP
70 urllib2
.urlopen(r
).read(1)
72 from encodings
import ascii
73 from codecs
import lookup
79 w
.destroy() # Init everything
82 log
= file('leak-log', 'w')
86 for x
in gc
.get_objects():
96 GUIView
.menu
.__dict
__ = {}
100 for x
in gc
.get_objects():
103 print>>log
, "New %s: %s" % (type(x
), `x`
)
104 for y
in gc
.get_referrers(x
):
105 if y
is not globals() and id(y
) in old
:
107 print>>log
, "\t(dict, key is %s)" % [k
for k
in y
if y
[k
] is x
]
108 print>>log
, "\t%s" % `y`