~nataliabidart/software-center/the-organizer

« back to all changes in this revision

Viewing changes to softwarecenter/ui/gtk3/panes/historypane.py

  • Committer: Natalia B. Bidart
  • Date: 2012-05-30 18:39:55 UTC
  • 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:
393
393
                    action_text = _('removed %s') % time_text
394
394
                elif action == self.UPGRADED:
395
395
                    action_text = _('updated %s') % time_text
396
 
            text = ('<span color="%(color)s">%(action)s</span>' %
397
 
                {'color': '#8A8A8A', 'action': action_text})
 
396
            color = {'color': '#8A8A8A', 'action': action_text}
 
397
            text = '<span color="%(color)s">%(action)s</span>' % color
398
398
        cell.set_property('markup', text)
399
 
 
400
 
 
401
 
def get_test_window():
402
 
 
403
 
    from softwarecenter.testutils import (get_test_db,
404
 
                                          get_test_gtk3_viewmanager,
405
 
                                          get_test_pkg_info,
406
 
                                          get_test_gtk3_icon_cache,
407
 
                                          )
408
 
    # needed because available pane will try to get it
409
 
    vm = get_test_gtk3_viewmanager()
410
 
    vm  # make pyflakes happy
411
 
    db = get_test_db()
412
 
    cache = get_test_pkg_info()
413
 
    icons = get_test_gtk3_icon_cache()
414
 
 
415
 
    widget = HistoryPane(cache, db, None, icons, None)
416
 
    widget.show()
417
 
 
418
 
    win = Gtk.Window()
419
 
    win.add(widget)
420
 
    win.set_size_request(600, 500)
421
 
    win.set_position(Gtk.WindowPosition.CENTER)
422
 
    win.show_all()
423
 
    win.connect('destroy', Gtk.main_quit)
424
 
 
425
 
    widget.init_view()
426
 
    return win
427
 
 
428
 
if __name__ == '__main__':
429
 
    win = get_test_window()
430
 
    Gtk.main()