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

make FSImage.__str__ available in Python 3 #282

Merged
merged 3 commits into from May 18, 2018

Conversation

Projects
None yet
2 participants
@tlotze
Copy link
Contributor

tlotze commented May 17, 2018

In both Python 2 and 3, the tag() method returns the respective str type, so
the result can always be used for __str__. Without having this method
available in Python 3, the image tag cannot be included, for example, in
Chamaeleon page templates by simply accessing the image object, as that uses
i18n which in turn casts the object to the respective text (unicode) type. Not
implementing __str__ in Python 3 results in the object representation instead
of the tag in that case.

make FSImage.__str__ available in Python 3
In both Python 2 and 3, the tag() method returns the respective str type, so
the result can always be used for __str__. Without having this method
available in Python 3, the image tag cannot be included, for example, in
Chamaeleon page templates by simply accessing the image object, as that uses
i18n which in turn casts the object to the respective text (unicode) type. Not
implementing __str__ in Python 3 results in the object representation instead
of the tag in that case.

@tlotze tlotze requested a review from hannosch May 17, 2018

@icemac

icemac approved these changes May 18, 2018

Copy link
Member

icemac left a comment

LGTM.

A test would be nice as this method is currently untested.

tlotze and others added some commits May 18, 2018

Add change log.
[skip ci]

@icemac icemac merged commit c5433f2 into master May 18, 2018

@icemac icemac deleted the image-tag branch May 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.