def _get_powercfg_minute_values(scheme, guid, subguid, safe_name):
 if (scheme is None):
  scheme = _get_current_scheme()
 if (__grains__['osrelease'] == '7'):
  cmd = 'powercfg /q {0} {1}'.format(scheme, guid)
 else:
  cmd = 'powercfg /q {0} {1} {2}'.format(scheme, guid, subguid)
 out = __salt__['cmd.run'](cmd, python_shell=False)
 split = out.split('\r\n\r\n')
 if (len(split) > 1):
  for s in split:
   if ((safe_name in s) or (subguid in s)):
    out = s
    break
 else:
  out = split[0]
 raw_settings = re.findall('Power Setting Index: ([0-9a-fx]+)', out)
 return {'ac': (int(raw_settings[0], 0) / 60), 'dc': (int(raw_settings[1], 0) / 60)}

def _get_powercfg_minute_values ( scheme , guid , subguid , safe_name ) : if ( scheme is None ) : scheme = _get_current_scheme ( ) if ( __grains__ [ 'osrelease' ] == '7' ) : cmd = 'powercfg /q {0} {1}' . format ( scheme , guid ) else : cmd = 'powercfg /q {0} {1} {2}' . format ( scheme , guid , subguid ) out = __salt__ [ 'cmd.run' ] ( cmd , python_shell = False ) split = out . split ( '\r\n\r\n' ) if ( len ( split ) > 1 ) : for s in split : if ( ( safe_name in s ) or ( subguid in s ) ) : out = s break else : out = split [ 0 ] raw_settings = re . findall ( 'Power Setting Index: ([0-9a-fx]+)' , out ) return { 'ac' : ( int ( raw_settings [ 0 ] , 0 ) / 60 ) , 'dc' : ( int ( raw_settings [ 1 ] , 0 ) / 60 ) }
returns the ac/dc values in an array for a guid and subguid for a the given scheme .