def linux_standby():
 if (not HAVE_DBUS):
  return
 (proxy, interface) = _get_sessionproxy()
 if proxy:
  if proxy.CanSuspend():
   proxy.Suspend(dbus_interface=interface)
 else:
  (proxy, interface, pinterface) = _get_systemproxy('UPower')
  if (not proxy):
   (proxy, interface, pinterface) = _get_systemproxy('DeviceKit')
  if proxy:
   if proxy.Get(interface, 'can-suspend', dbus_interface=pinterface):
    try:
     proxy.Suspend(dbus_interface=interface)
    except dbus.exceptions.DBusException as msg:
     logging.info('Received a DBus exception %s', msg)
  else:
   logging.info('DBus does not support Suspend (standby)')
 time.sleep(10)

def linux_standby ( ) : if ( not HAVE_DBUS ) : return ( proxy , interface ) = _get_sessionproxy ( ) if proxy : if proxy . CanSuspend ( ) : proxy . Suspend ( dbus_interface = interface ) else : ( proxy , interface , pinterface ) = _get_systemproxy ( 'UPower' ) if ( not proxy ) : ( proxy , interface , pinterface ) = _get_systemproxy ( 'DeviceKit' ) if proxy : if proxy . Get ( interface , 'can-suspend' , dbus_interface = pinterface ) : try : proxy . Suspend ( dbus_interface = interface ) except dbus . exceptions . DBusException as msg : logging . info ( 'Received a DBus exception %s' , msg ) else : logging . info ( 'DBus does not support Suspend (standby)' ) time . sleep ( 10 )
make linux system go into standby .