

def list_fields_and_values(self, field_names=None):
    'List (extract) user-fields with type and value.\n\n        field_names ... list of field names to show or None for all.\n\n        Returns list of tuples (<field name>, <field type>, <value>).\n\n        '
    self.loaddoc()
    found_fields = []
    all_fields = self.document.getElementsByType(UserFieldDecl)
    for f in all_fields:
        value_type = f.getAttribute('valuetype')
        if (value_type == 'string'):
            value = f.getAttribute('stringvalue')
        else:
            value = f.getAttribute('value')
        field_name = f.getAttribute('name')
        if ((field_names is None) or (field_name in field_names)):
            found_fields.append((field_name.encode(OUTENCODING), value_type.encode(OUTENCODING), value.encode(OUTENCODING)))
    return found_fields

dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf3/userfield.py UserFields.list_fields_and_values/original