Baul.ColumnProvider
Prev | Provider Interfaces | Next

## Baul.ColumnProvider

Baul.ColumnProvider — Baul.ColumnProvider Reference

## Synopsis

    class Baul.ColumnProvider:
        def get_columns()

## Description

If subclassed, Baul will request a list of `Baul.Column` objects, which are then displayed when the user is in `List` mode.

### Note

An extension sub-classing `Baul.ColumnProvider` will almost always want to sub-class `Baul.InfoProvider` as well, since that is how an extension provides information for each item in a directory listing.

Example 2. Baul.ColumnProvider Example

    import os
    import urllib

    from gi.repository import Baul, GObject

    class ColumnExtension(GObject.GObject, Baul.ColumnProvider, Baul.InfoProvider):
        def __init__(self):
            pass

        def get_columns(self):
            return Baul.Column(name="BaulPython::block_size_column",
                                   attribute="block_size",
                                   label="Block size",
                                   description="Get the block size"),

        def update_file_info(self, file):
            if file.get_uri_scheme() != 'file':
                return

            filename = urllib.unquote(file.get_uri()[7:])

            file.add_string_attribute('block_size', str(os.stat(filename).st_blksize))

## Passive Methods

### Baul.ColumnProvider.get_columns

        def get_columns()

Returns : | a list of `Baul.Column`

The `get_columns`() method returns a list of `Baul.Column`.

Prev | Up | Next
Provider Interfaces | Home | Baul.InfoProvider