您的位置:首页 > 编程语言 > Python开发

wxPython 2.8.8.1 Boa startup error

2008-09-17 21:47 141 查看
I've installed the latest version of wxPython (2.8.8.1) and now Boa

Constructor won't start. I'm on Windows XP SP2 and Python 2.5.2.

Here's the traceback I get:

C:/Program Files/Boa-0.6.0/boa>boa.py

Starting Boa Constructor v0.6.1

importing wxPython

reading user preferences

Traceback (most recent call last):

File "C:/Program Files/Boa-0.6.0/boa/Boa.py", line 271, in <module>

import Preferences, Utils

File "C:/Program Files/Boa-0.6.0/boa/Preferences.py", line 174, in <module>

c = wx.FileConfig(localFilename=file, style= wx.CONFIG_USE_LOCAL_FILE)

File "C:/Python25/Lib/site-packages/wx-2.8-msw-unicode/wx/_misc.py", line 3313

, in __init__

_misc_.FileConfig_swiginit(self,_misc_.new_FileConfig(*args, **kwargs))

wx._core.PyNoAppError: The wx.App object must be created first!

==============================================================

The code causing a problem is trying to upgrade the config files for a new version of Boa. 

 

Riaan will fix this when he finds some time but in the meantime just bypass/not execute the wx.FileConfig stuff works for me and allows me to use 2.8.8.1. 

 

Here is the changed code in boa/preferences.py, for anyone else who would like to use 2.8.8.1: 

 

# wx.FileConfig files 

for confFile, version in (('stc-styles.rc.cfg', 1),): 

file = os.path.join(rcPath, confFile) 

confVersion = 0 

if os.path.exists(file): 

# don't do the wx.FileConfig version verification/upgrade until Riaan can fix this 

pass 

#c = wx.FileConfig(localFilename=file, style= wx.CONFIG_USE_LOCAL_FILE) 

#confVersion = c.ReadInt('/resourceconfig/version') 

 

#if confVersion < version: 

# _backupAndCopyNewestConfig(confFile, file, '.cfg') 

else: 

shutil.copy2(os.path.join(pyPath, 'Config', confFile), file) 

 

Werner

来源:
http://sourceforge.net/mailarchive/forum.php?thread_name=4ca041a00808101906j75a0839xa37a37bd2472af03%40mail.gmail.com&forum_name=boa-constructor-users
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐