home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2012 January / maximum-cd-2012-01.iso / DiscContents / digsby_setup.exe / lib / plugins / digsby_updater / machelpers.pyo (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2011-10-05  |  1.4 KB  |  39 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.6)
  3.  
  4. import os
  5. import sys
  6.  
  7. def update_and_restart(tempdir):
  8.     import wx
  9.     updater = os.path.join(os.getcwd(), 'mac_updater.pyc')
  10.     Authorization = Authorization
  11.     kAuthorizationFlagDestroyRights = kAuthorizationFlagDestroyRights
  12.     import Authorization
  13.     auth = Authorization(destroyflags = (kAuthorizationFlagDestroyRights,))
  14.     
  15.     try:
  16.         python = sys.executable
  17.         pipe = auth.executeWithPrivileges(python, updater, tempdir)
  18.         output = pipe.read()
  19.         if output.find('error') != -1:
  20.             wx.MessageBox(_('Error while updating Digsby. Please restart and try again, or grab the latest version from digsby.com. Digsby will now shut down.'))
  21.             pipe.close()
  22.             wx.GetApp().ExitMainLoop()
  23.             return None
  24.         pipe.close()
  25.         wx.MessageBox(_('Updated successfully. Digsby now needs to restart.'))
  26.         os.spawnv(os.P_NOWAIT, python, [
  27.             'python',
  28.             updater,
  29.             'restart'])
  30.         wx.GetApp().ExitMainLoop()
  31.     except:
  32.         wx.MessageBox(_('Unable to authenticate. Please restart and try again.'))
  33.  
  34.  
  35.  
  36. def platform_cleanup():
  37.     return []
  38.  
  39.