~nataliabidart/software-center/winged-migration

« back to all changes in this revision

Viewing changes to softwarecenter/ui/gtk3/widgets/spinner.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:
114
114
            self._last_timeout_id = None
115
115
        self.spinner_view.stop_and_hide()
116
116
        self.set_current_page(self.CONTENT_PAGE)
117
 
 
118
 
 
119
 
def get_test_spinner_window():
120
 
    label = Gtk.Label("foo")
121
 
    spinner_notebook = SpinnerNotebook(label, "random msg")
122
 
 
123
 
    window = Gtk.Window()
124
 
    window.add(spinner_notebook)
125
 
    window.set_size_request(600, 500)
126
 
    window.set_position(Gtk.WindowPosition.CENTER)
127
 
    window.show_all()
128
 
    window.connect('destroy', Gtk.main_quit)
129
 
    spinner_notebook.show_spinner("Loading for 1s ...")
130
 
    GObject.timeout_add_seconds(1, lambda: spinner_notebook.hide_spinner())
131
 
    return window
132
 
 
133
 
if __name__ == "__main__":
134
 
    win = get_test_spinner_window()
135
 
    Gtk.main()