[master 1/1] Decode wifi SSIDs into strings. (#1240398)
dashea
installerbot-noreply at redhat.com
Mon Jul 13 19:23:45 UTC 2015
In reply to line 1081 of pyanaconda/ui/gui/spokes/network.py:
$ cat test.glade
```
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<interface>
<requires lib="gtk+" version="3.12"/>
<object class="GtkListStore" id="test_store">
<columns>
<!-- column-name str -->
<column type="gchararray"/>
<!-- column-name bytes -->
<column type="GBytes"/>
</columns>
</object>
<object class="GtkWindow" id="test_window">
<property name="can_focus">False</property>
<child>
<object class="GtkComboBox" id="combobox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="model">test_store</property>
<child>
<object class="GtkCellRendererText" id="comborenderer"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
</object>
</interface>
```
dshea at dhcp-189-44:~/tmp$ cat test.py
```
#!/usr/bin/python3
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
builder = Gtk.Builder.new_from_file('test.glade')
store = builder.get_object('test_store')
store.append(['asdf', b'asdf'])
window = builder.get_object('test_window')
window.connect('delete-event', Gtk.main_quit)
window.show_all()
Gtk.main()
```
dshea at dhcp-189-44:~/tmp$ python3 test.py
(test.py:18369): Gtk-WARNING **: Unknown type GBytes specified in treemodel test_store
(test.py:18369): Gtk-WARNING **: gtkliststore.c:516: Invalid type (null)
Traceback (most recent call last):
File "test.py", line 11, in <module>
store.append(['asdf', b'asdf'])
File "/usr/lib64/python3.4/site-packages/gi/overrides/Gtk.py", line 956, in append
return self._do_insert(-1, row)
File "/usr/lib64/python3.4/site-packages/gi/overrides/Gtk.py", line 947, in _do_insert
row, columns = self._convert_row(row)
File "/usr/lib64/python3.4/site-packages/gi/overrides/Gtk.py", line 857, in _convert_row
result.append(self._convert_value(cur_col, value))
File "/usr/lib64/python3.4/site-packages/gi/overrides/Gtk.py", line 875, in _convert_value
return GObject.Value(self.get_column_type(column), value)
File "/usr/lib64/python3.4/site-packages/gi/overrides/GObject.py", line 216, in __init__
self.init(value_type)
TypeError: Must be gobject.GType, not gobject.GType
--
To view this comment on github, visit https://github.com/dashea/anaconda/commit/81bfaf4aa77813277dc5157c960ecb7172fc5a44#commitcomment-12140873
More information about the anaconda-patches
mailing list