cygnusnow / ulipad

Automatically exported from code.google.com/p/ulipad
0 stars 0 forks source link

ubuntu 12.04 下 菜单->编辑->参数 窗口无法显示 #302

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. 其余的像 菜单->文档->语法参数 这个窗口是可以显示的
2.
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
ubuntu 12.04 64bits

Please provide any additional information below.
error.txt:
[Traceback]Traceback (most recent call last):
  File "/home/zhangclb/oss/ulipad/modules/Mixin.py", line 133, in callplugin
    f(*args, **kwargs)
  File "/home/zhangclb/oss/ulipad/mixins/Import.py", line 8329, in on_document_enter
    get_state(document)
  File "/home/zhangclb/oss/ulipad/mixins/Import.py", line 8309, in get_state
    if not pref.smart_nav_files or pref.smart_nav_files[pref.smart_nav_cur][0] != filename:   #add new file
IndexError: list index out of range

[Traceback]Traceback (most recent call last):
  File "/home/zhangclb/oss/ulipad/mixins/Import.py", line 73, in OnOptionPreference
    dlg = PrefDialog.PrefDialog(win)
  File "/home/zhangclb/oss/ulipad/mixins/PrefDialog.py", line 137, in __init__
    self.addPages(self.treebook)
  File "/home/zhangclb/oss/ulipad/mixins/PrefDialog.py", line 181, in addPages
    self.addItem(page, kind, prefname, prefvalue, message, extern)
  File "/home/zhangclb/oss/ulipad/mixins/PrefDialog.py", line 270, in addItem
    page.box.add(label, obj, name=prefname, span=span)
  File "/home/zhangclb/oss/ulipad/modules/meide.py", line 1056, in add
    self._create_element(name, element, args, len(self.orders) - 1)
  File "/home/zhangclb/oss/ulipad/modules/meide.py", line 572, in _create_element
    e.create(self.win, self.namebinding)
  File "/home/zhangclb/oss/ulipad/modules/meide.py", line 105, in _f
    r = f(self, win, namebinding)
  File "/home/zhangclb/oss/ulipad/modules/meide.py", line 1249, in create
    self.SetValue(value)
  File "/home/zhangclb/oss/ulipad/modules/meide.py", line 1360, in SetValue
    key = [k for k, v in self.value_dict.items() if v == value][0]
IndexError: list index out of range

Original issue reported on code.google.com by zhangchu...@gmail.com on 25 Sep 2012 at 2:31

GoogleCodeExporter commented 9 years ago
如果是wxpython 2.9目前是不支持的。建议使用2.8.x版本。

Original comment by limo...@gmail.com on 25 Sep 2012 at 4:17

GoogleCodeExporter commented 9 years ago
我就是装的 python-wxgtk2.8 啊,没用 2.9

Original comment by zhangchu...@gmail.com on 25 Sep 2012 at 5:32

GoogleCodeExporter commented 9 years ago
是在做什么的时候,可以重现吗?

Original comment by limo...@gmail.com on 25 Sep 2012 at 5:35

GoogleCodeExporter commented 9 years ago
从我切换到 12.04 
以后就一直都是这样,这个窗口就没打开过,我试过最后那个 
traceback 
在每次点击这个菜单或者按钮的时候就会出来,我尝试查查看�
��

Original comment by zhangchu...@gmail.com on 25 Sep 2012 at 5:43

GoogleCodeExporter commented 9 years ago
我在meide.py里的1359行的SetValue里加了print

    def SetValue(self, value):
        print value,repr([k for k, v in self.value_dict.items() if v == value])
结果打印出来的是

RIGHT ['Right']
bottom ['Bottom']
0 [u'Unix \u6a21\u5f0f (\\n)']
0 [u'\u5230Html\u7a97\u53e3']
0 [u'\u9876\u90e8']
UTF8 []

最后有个 []

于是把SetValue里改判断如果[]长度>0才去set,再看error.txt又有新�
�� traceback:

[Traceback]Traceback (most recent call last):
  File "/home/zhangclb/oss/ulipad/mixins/Import.py", line 73, in OnOptionPreference
    dlg = PrefDialog.PrefDialog(win)
  File "/home/zhangclb/oss/ulipad/mixins/PrefDialog.py", line 157, in __init__
    self.values = self.get_values()
  File "/home/zhangclb/oss/ulipad/mixins/PrefDialog.py", line 294, in get_values
    values.update(b.GetValue())
  File "/home/zhangclb/oss/ulipad/modules/meide.py", line 655, in GetValue
    v = obj.GetValue()
  File "/home/zhangclb/oss/ulipad/modules/meide.py", line 1367, in GetValue
    return self.value_dict[value]
KeyError: u''

接下来就不知道怎么改了,看起来是 PrefDialog.py 里的 
b.GetValue() 导致的

Original comment by zhangchu...@gmail.com on 25 Sep 2012 at 6:51

GoogleCodeExporter commented 9 years ago
这个上面的意思是key为 u'' 
,找不到。不过我查了一下程序,怎么和我的代码不同呢?要�
��你从Svn中下载源码试试。

Original comment by limo...@gmail.com on 25 Sep 2012 at 6:57

GoogleCodeExporter commented 9 years ago
汗,重拿了份代码确实不会了,不会又是 hgsubversion 的问题吧...
我再把相关的配置merge过来看看

Original comment by zhangchu...@gmail.com on 25 Sep 2012 at 7:09

GoogleCodeExporter commented 9 years ago
汗..把原来的ulipad.ini拷来以后又是一样的了,看来跟12.04没关��
�,我上载一下我本地会出问题的 ini

Original comment by zhangchu...@gmail.com on 25 Sep 2012 at 7:27

Attachments:

GoogleCodeExporter commented 9 years ago
这个不太好看。

Original comment by limo...@gmail.com on 25 Sep 2012 at 7:31

GoogleCodeExporter commented 9 years ago
找到了
default_encoding='UTF8'
这样就会出现问题
如果是
default_encoding='UTF-8'
就可以正常显示

Original comment by zhangchu...@gmail.com on 25 Sep 2012 at 8:12

GoogleCodeExporter commented 9 years ago
和这个还有关系啊。这个是ulipad缺省提供的吗?要不要修改��
�下。

Original comment by limo...@gmail.com on 25 Sep 2012 at 8:59

GoogleCodeExporter commented 9 years ago
我应该没改过这个配置的说,不知道有没有别人碰到,建议还是
改下,呵呵,设为 'UTF8'也应该是合理的嘛.

Original comment by zhangchu...@gmail.com on 25 Sep 2012 at 9:33

GoogleCodeExporter commented 9 years ago
这个值缺省是从系统来的,如果系统设的是UTF8那得到的就是�
��个。

Original comment by limo...@gmail.com on 25 Sep 2012 at 9:54

GoogleCodeExporter commented 9 years ago
那也不应该导致这种问题啊

Original comment by zhangchu...@gmail.com on 26 Sep 2012 at 12:51