-
Notifications
You must be signed in to change notification settings - Fork 1
/
metamorphose.py
executable file
·95 lines (79 loc) · 2.73 KB
/
metamorphose.py
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#Boa:App:BoaApp
#
# This is the control module, it loads the main application.
#
# This is what you should run to start the program.
#
"""
Copyright (C) 2005-2010 Ianaré Sévi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
--
All translations also copyright (c) Ianaré Sévi, under BSD license.
"""
import sys
# Choose wxPython version if not running as frozen binary
if not hasattr(sys, "frozen"):
try:
import wxversion
except:
print "\nwxPython is required!\nRefer to 'readme_xx.html'",\
"for installation instructions.\n"
sys.exit()
else:
try:
wxversion.select(['2.6', '2.8'])
except:
print "wxPython version 2.6 or 2.8 is required.\n"
sys.exit()
import wx
import os
import platform
modules ={u'DateTime': [0, '', u'DateTime.py'],
u'PyAlpha': [0, '', u'PyAlpha.py'],
u'about': [0, u'about box', u'about.py'],
u'errors': [0, '', u'errors.py'],
u'examples': [0, '', u'examples.py'],
u'helpDiag': [0, '', u'helpDiag.py'],
u'id3reader': [0, '', u'id3reader.py'],
u'langSelect': [0, '', u'langSelect.py'],
u'main': [0, '', u'main.py'],
u'main_window': [1, u'Main frame of Application', u'main_window.py'],
u'numbering': [0, '', u'numbering.py'],
u'picker': [0, '', u'picker.py'],
u'preferences': [0, u'preferences selection', u'preferences.py'],
u'roman': [0, '', u'roman.py']}
class BoaApp(wx.App):
def OnInit(self):
import main_window
wx.InitAllImageHandlers()
self.main = main_window.create(None)
self.main.Show()
self.SetTopWindow(self.main)
return True
def main():
if platform.system() == 'Linux':
try:
# to fix some KDE display issues:
del os.environ['GTK_RC_FILES']
del os.environ['GTK2_RC_FILES']
except (ValueError, KeyError):
pass
application = BoaApp(0)
application.MainLoop()
if __name__ == '__main__':
if 'unicode' not in wx.PlatformInfo:
print "\nInstalled version: %s\nYou need a unicode build of wxPython to run Metamorphose.\n"%wxversion.getInstalled()
else:
main()