Logo Search packages:      
Sourcecode: samba-gtk version File versions  Download package

def sambagtk::pygwregedit::WinRegPipeManager::get_values_for_key (   self,
  key 
)
this function gets a list of values for 'key'

returns a list of values

Definition at line 210 of file pygwregedit.py.

                                     :
        """this function gets a list of values for 'key'
        
        returns a list of values"""
        
        value_list = []
        path_handles = self.open_path(key)
        key_handle = path_handles[-1]
        index = 0
        
        while True: #get a list of values for the key
            try:
                (value_name, 
                 value_type, 
                 value_data, 
                 value_length) = self.pipe.EnumValue(key_handle,
                                                     index, 
                                                     WinRegPipeManager.winreg_val_name_buf(""), 
                                                     0, 
                                                     [], 
                                                     8192
                                                     )
                
                value = RegistryValue(value_name.name, value_type, value_data, key)
                value_list.append(value)

                index += 1

            except RuntimeError as re:
                if (re.args[0] == 0x103): #0x103 is WERR_NO_MORE_ITEMS
                    break
                else:
                    raise re

        self.close_path(path_handles)
        
        #Every key is supposted to have a default value. If this key doesn't have one, we'll display a blank one
        default_value_list = [value for value in value_list if value.name == ""]
        if (len(default_value_list) == 0):
            value = RegistryValue("(Default)", misc.REG_SZ, [], key)
            value_list.append(value)
        else:
            default_value_list[0].name = "(Default)"
        
        return value_list
    

Generated by  Doxygen 1.6.0   Back to index