need to bring formatters back from tablib

Bug #1308744 reported by Doug Hellmann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cliff
Fix Released
Wishlist
Unassigned

Bug Description

Several useful formatters that depend on tablib were moved to a separate lib to satisfy debian packaging requirements (something to do with tablib vendoring some other library). We should revisit, and either reimplement them or just bring them back into cliff.

Changed in python-cliff:
status: New → Confirmed
importance: Undecided → Wishlist
Revision history for this message
Steve Baker (steve-stevebaker) wrote :

Arguments for removing the tablib formatters:
- tablib vendors mulitple dependencies
- tablib is supposed to be for formatting tabular data, but yaml and json are not tabular formats so would be better off being implemented in cliff
- since the table formatter is already from cliff, this would leave the html formatter as the only remaining formatter. Its possible nobody is even interested in this one

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to cliff (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/213869

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to cliff (master)

Reviewed: https://review.openstack.org/209334
Committed: https://git.openstack.org/cgit/openstack/cliff/commit/?id=0a8daff7bdad7c56bc7b9dc2d6dea6b7259d2827
Submitter: Jenkins
Branch: master

commit 0a8daff7bdad7c56bc7b9dc2d6dea6b7259d2827
Author: Steve Baker <email address hidden>
Date: Wed Aug 5 16:16:54 2015 +1200

    Implement a yaml formatter in cliff

    This change replaces the cliff-tablib yaml formatter with an internal
    replacement. It differs from the tablib formatter in the following ways:
    - always outputs with block formatting rather than the PyYAML default
      of deciding based on value content
    - emit_one serialises a simple dict where the column name is the key
      and the data item is the value (rather than a list of dicts with
      'Field' and 'Value' keys)
    - emit_one preserves column order by printing a single-item dict for
      each column_name

    The cliff release which contains this change will need a corresponding
    cliff-tablib release which removes the yaml formatter from its setup.py
    entry_points.

    Change-Id: I691dbab3dee7c5ec28b1083f87ab1f5c051d582b
    Related-Bug: #1308744

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/213869
Committed: https://git.openstack.org/cgit/openstack/cliff/commit/?id=4e1470d93e101d1390b39b93dec569c7c8966b83
Submitter: Jenkins
Branch: master

commit 4e1470d93e101d1390b39b93dec569c7c8966b83
Author: Steve Baker <email address hidden>
Date: Mon Aug 17 15:29:29 2015 +1200

    Implement a json formatter in cliff

    This change replaces the cliff-tablib json formatter with an internal
    replacement. It differs from the tablib formatter in the following ways:
    - by default outputs with an indent of 2 spaces. The --noindent formatting
      argument outputs with no indentation, to save space or to pipe to tools
      which can't handle multi-line input.
    - emit_one serialises a simple dict where the column name is the key
    and the data item is the value (rather than a list of dicts with
    'Field' and 'Value' keys)

    The cliff release which contains this change will need a corresponding
    cliff-tablib release which removes the json formatter from its setup.py
    entry_points.

    Change-Id: I7f9b1f339d96ead347a0c9d95ec7004a78d8c9d5
    Related-Bug: #1308744

Revision history for this message
Steve Baker (steve-stevebaker) wrote :

Assuming that nobody cares about the html formatter, this could be marked FixedReleased in 1.15.0

Revision history for this message
Steve Martinelli (stevemar) wrote :

This was released a long time ago.

Changed in python-cliff:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.