Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically load exported style names #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jonas0616
Copy link

@jonas0616 jonas0616 commented Aug 15, 2017

In the tutorial, we can change the output style via set_style(), and MSWORD_FRIENDLY is one of the styles which can be imported as following:

from prettytable import MSWORD_FRIENDLY

It also mentioned there are another styles, e.g., PLAIN_COLUMNS. However, it failed to import via the same way.

from prettytable import PLAIN_COLUMNS

result:

Traceback (most recent call last):
  File "./pptest.py", line 3, in <module>
    from prettytable import PLAIN_COLUMNS
ImportError: cannot import name PLAIN_COLUMNS

I am unable to solve it until tracing the source code, and change to the following import statement:

from prettytable.prettytable import PLAIN_COLUMNS

I am of the opinion that it should automatically load all exported styles instead of only partial ones. If not, it should then add some notes in tutorial to clarify the usage.

@coveralls
Copy link

coveralls commented Aug 15, 2017

Coverage Status

Coverage increased (+0.02%) to 77.488% when pulling dbbeb25 on jonas0616:export-style-name into 4676e41 on kxxoling:master.

@hugovk
Copy link
Contributor

hugovk commented Nov 1, 2020

Tip: this is fixed in upstream PrettyTable.

https://github.com/jazzband/prettytable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants