How do I convert this python2 statement to python3?

I'm trying to update an appindicator I was using under Ubuntu 14.04, but doesn't work under 15.04. I was able to work through most of the other issues in the code until I got to this one function:

def add_profile_input(self):
    Add a 'profile' combobox input to the HostDialog.
    client = GConf.Client.get_default()
    list_key = '/apps/gnome-terminal/global/profile_list'
    name_key = '/apps/gnome-terminal/profiles/%s/visible_name'

    ##  The problem is this line:
    profile_names = [client.get_string(name_key % name) for name in
                  client.get_list(list_key, 'string')]

    self.profile_entry = Gtk.ComboBoxText.new_with_entry()

    for name in profile_names:

    index = 0
    if != '' and != "<None>":
        index = profile_names.index( + 1

    self.add_input('Profile', widget=self.profile_entry)

When running the program I get this output:

Traceback (most recent call last):
  File "bin/", line 935, in btn_add_pressed
    item = dialog.invoke()
  File "bin/", line 1045, in invoke
    dialog = self.build_dialog()
  File "bin/", line 1118, in build_dialog
  File "bin/", line 1171, in add_profile_input
    client.get_list(list_key, 'string')]
AttributeError: 'Client' object has no attribute 'get_list'

It appears that python2/gtk2 has no problem with it, 'get_list' is a defined method, but trying to convert this to python3/gtk3 doesn't work because there is no 'get_list' method.

How do I fix this? As you can probably tell, I'm a novice with python.


PyGobject (aka PyGI) does not export a get_list interface.

You could get a GConf.Value using GConf.Client.get and then get the list using GConf.Value.get_list.

Need Your Help

Knowing screen coordinate in Qt

qt qt4

How to know the coordinate of right hand side bottom of the scrren during runtime ?

Replacing </div> with <\/div>

javascript regex node.js underscore.js

I'm attempting to replicate the kind of data passed in an alternate sample of some code. I am attempting to recreate a NodeJS implementation based on C# and PHP samples.