Did I find the right examples for you? yes no

All Samples(5)  |  Call(5)  |  Derive(0)  |  Import(0)
Decode labels when they are received as utf7 entities or numbers

        def decode_labels(labels):
    """
       Decode labels when they are received as utf7 entities or numbers
    """
    new_labels = []
    for label in labels:
        if isinstance(label, (int, long, float, complex)):
            label = str(label) 
        new_labels.append(utf7_decode(label))

    return new_labels
        


src/g/m/gmvault-HEAD/src/sandbox/common_gmvault.py   gmvault(Download)
                    #decode the labels that are received as utf7 => unicode
                    new_data[the_id][imap_utils.GIMAPFetcher.GMAIL_LABELS] = \
                    imap_utils.decode_labels(new_data[the_id][imap_utils.GIMAPFetcher.GMAIL_LABELS])
 
                    #pass the dir and the ID

src/g/m/gmvault-HEAD/src/gmv/gmvault.py   gmvault(Download)
                    #decode the labels that are received as utf7 => unicode
                    new_data[the_id][imap_utils.GIMAPFetcher.GMAIL_LABELS] = \
                    imap_utils.decode_labels(new_data[the_id][imap_utils.GIMAPFetcher.GMAIL_LABELS])
 
                    LOG.debug("metadata info collected: %s\n" % (new_data[the_id]))

src/g/m/gmvault-1.8.1-beta/src/gmv/gmvault.py   gmvault(Download)
                    #decode the labels that are received as utf7 => unicode
                    new_data[the_id][imap_utils.GIMAPFetcher.GMAIL_LABELS] = \
                    imap_utils.decode_labels(new_data[the_id][imap_utils.GIMAPFetcher.GMAIL_LABELS])
 
                    LOG.debug("metadata info collected: %s\n" % (new_data[the_id]))

src/g/m/gmvault-HEAD/src/gmv/test_utils.py   gmvault(Download)
            disk_labels.append(x_lab)
 
        online_labels = imap_utils.decode_labels(online_metadata[imap_id].get('X-GM-LABELS', None)) 
 
        #clean potential labels with multiple spaces

src/g/m/gmvault-1.8.1-beta/src/gmv/test_utils.py   gmvault(Download)
            disk_labels.append(x_lab)
 
        online_labels = imap_utils.decode_labels(online_metadata[imap_id].get('X-GM-LABELS', None)) 
 
        #clean potential labels with multiple spaces