def _get(self):
        '''
        get the value for user in gsettings

        '''
        user = self.USER
        try:
            uid = pwd.getpwnam(user).pw_uid
        except KeyError:
            log.info('User does not exist')
            return False

        cmd = self.gsetting_command + ['get', str(self.SCHEMA), str(self.KEY)]
        environ = {}
        environ['XDG_RUNTIME_DIR'] = '/run/user/{0}'.format(uid)
        result = __salt__['cmd.run_all'](cmd, runas=user, env=environ, python_shell=False)

        if 'stdout' in result:
            if 'uint32' in result['stdout']:
                return re.sub('uint32 ', '', result['stdout'])
            else:
                return result['stdout']
        else:
            return False
def _get ( self ) : user = self . USER try : uid = pwd . getpwnam ( user ) . pw_uid except KeyError : log . info ( 'User does not exist' ) return False cmd = self . gsetting_command + [ 'get' , str ( self . SCHEMA ) , str ( self . KEY ) ] environ = { } environ [ 'XDG_RUNTIME_DIR' ] = '/run/user/{0}' . format ( uid ) result = __salt__ [ 'cmd.run_all' ] ( cmd , runas = user , env = environ , python_shell = False ) if 'stdout' in result : if 'uint32' in result [ 'stdout' ] : return re . sub ( 'uint32 ' , '' , result [ 'stdout' ] ) else : return result [ 'stdout' ] else : return False
get the value for user in gsettings