~nataliabidart/software-center/winged-migration

« back to all changes in this revision

Viewing changes to softwarecenter/ui/gtk3/widgets/searchentry.py

  • Committer: Natalia B. Bidart
  • Date: 2012-05-30 18:39:55 UTC
  • mto: This revision was merged to the branch mainline in revision 3030.
  • Revision ID: natalia.bidart@canonical.com-20120530183955-zbnjczayktmmg5tv
- Initial test cleanup:
  - Renamed test/ dir to tests/.
  - Isolated test code into tests/ directory, including moving all the
    get_test_window_foo from the gtk3 production modules to
    tests/gtk3/windows.py module.
  - Removed all the calls to Gtk.main() in gtk3 tests since that blocks the
    execution of the suite.
  - Pep8 and pyflakes fixes in the files already modified in this branch.
  - Minor bug fix in the softwarecenter/log.py module when trying to create a
    log dir with proper perms.

Show diffs side-by-side

added added

removed removed

Lines of Context:
152
152
                self.set_icon_from_pixbuf(Gtk.EntryIconPosition.SECONDARY, pb)
153
153
        else:
154
154
            self.set_icon_from_stock(Gtk.EntryIconPosition.SECONDARY, None)
155
 
 
156
 
 
157
 
def on_entry_changed(self, terms):
158
 
    print(terms)
159
 
 
160
 
 
161
 
def get_test_searchentry_window():
162
 
    icons = Gtk.IconTheme.get_default()
163
 
    entry = SearchEntry(icons)
164
 
    entry.connect("terms-changed", on_entry_changed)
165
 
 
166
 
    win = Gtk.Window()
167
 
    win.connect("destroy", Gtk.main_quit)
168
 
    win.add(entry)
169
 
    win.set_size_request(400, 400)
170
 
    win.show_all()
171
 
    win.entry = entry
172
 
    return win
173
 
 
174
 
if __name__ == "__main__":
175
 
    win = get_test_searchentry_window()
176
 
    Gtk.main()