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 ConanOutput write methods chainable #12780

Conversation

AbrilRBS
Copy link
Member

@AbrilRBS AbrilRBS commented Dec 23, 2022

Changelog: Feature: Allow chaining of self.output write methods
Docs: omit

Allows the ConanOutput write methods to be chained, which simplifies some instances where it's used a lot, by removing the need to save it to a variable or initialize the object for every line

@AbrilRBS AbrilRBS requested a review from memsharded December 23, 2022 14:42

def rewrite_line(self, line):
tmp_color = self._color
self._color = False
TOTAL_SIZE = 70
LIMIT_SIZE = 32 # Hard coded instead of TOTAL_SIZE/2-3 that fails in Py3 float division
LIMIT_SIZE = TOTAL_SIZE // 2 - 3
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old comment complained about Py3 division being float by default. Using the built-in int division fixes the issue (//)

@AbrilRBS AbrilRBS marked this pull request as ready for review December 27, 2022 10:20
@AbrilRBS AbrilRBS assigned AbrilRBS and franramirez688 and unassigned AbrilRBS Dec 27, 2022
@memsharded memsharded added this to the 2.0.0-beta8 milestone Dec 27, 2022
@franramirez688 franramirez688 merged commit ce9c782 into conan-io:develop2 Dec 27, 2022
@AbrilRBS AbrilRBS deleted the rr/chainable-conanoutput-write-methods branch December 27, 2022 15:58
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