home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / lib / python2.4 / site-packages / UpdateManager / Common / utils.py < prev    next >
Encoding:
Python Source  |  2006-08-24  |  578 b   |  24 lines

  1. import gtk
  2.  
  3. def str_to_bool(str):
  4.   if str == "0" or str.upper() == "FALSE":
  5.     return False
  6.   return True
  7.  
  8. def utf8(str):
  9.   return unicode(str, 'latin1').encode('utf-8')
  10.  
  11.  
  12. def error(parent, summary, message):
  13.   d = gtk.MessageDialog(parent=parent,
  14.                         flags=gtk.DIALOG_MODAL,
  15.                         type=gtk.MESSAGE_ERROR,
  16.                         buttons=gtk.BUTTONS_CLOSE)
  17.   d.set_markup("<big><b>%s</b></big>\n\n%s" % (summary, message))
  18.   d.realize()
  19.   d.window.set_functions(gtk.gdk.FUNC_MOVE)
  20.   d.set_title("")
  21.   res = d.run()
  22.   d.destroy()
  23.   return
  24.