tienbm90 / prettytable

Automatically exported from code.google.com/p/prettytable
Other
0 stars 0 forks source link

Document printt's removal #14

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. printt is gone but the tutorials still refer to it.
2. Since other code (e.g., python-socialtext) uses printt, document that printt 
was replaced by get_string.
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by George.V...@gmail.com on 15 Jun 2012 at 9:56

GoogleCodeExporter commented 8 years ago
I can't try out openstack-compute because of this change. Is it possible to add 
printt back?

Original comment by tonybr...@gmail.com on 17 Jun 2012 at 5:24

GoogleCodeExporter commented 8 years ago
@George.V.Reilly: Thanks for pointing this out, you are right that an update to 
the tutorials is long overdue.  I'll try to get this fixed up a bit today.

@tonybr777: Sorry, but I decided to remove printt for good reason: as long as 
there exists a method to fetch a string of a table (and there always should be 
such a method, so that people can e.g. save tables to files) then having a 
dedicated printing method is entirely redundant since Python has inbuilt 
printing functions that can be used to print the string.  Printt was also an 
obstacle to Python3 compatibility, since the inbuilt printing function is 
different in 2.x and 3.x.  Getting rid of printt improved and simplified the 
overall API, and adding it back would be a backward step.

If you need to try out some software that makes use of printt, your best 
options are to either install PrettyTable 0.5 (with e.g. "easy_install 
PrettyTable==0.5") and just use that, or to update the software to no longer 
use printt.  It looks like openstack-compute only uses printt in two places, in 
the file openstack.compute/openstack/compute/shell.py, so this should be very 
easy.  Just replace "pt.printt(**kwargs)" with "print pt.get_string(**kwargs)" 
for 2.x or "print(pt.get_string(**kwargs)" for 3.x.

Original comment by luke@maurits.id.au on 17 Jun 2012 at 6:45

GoogleCodeExporter commented 8 years ago
Today, after releasing 0.7, I have deleted the old Tutorial0.6 wiki page, and 
updated the Tutorial wiki page.  The Tutorial page now has no references to 
printt, and none of the examples do things "the old way".  So finally it should 
be impossible for anybody to get confused in the future.  Therefore I'm closing 
this issue.

Original comment by luke@maurits.id.au on 17 Feb 2013 at 7:54