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

Added Image.blank() #60

Merged
merged 1 commit into from Sep 19, 2012
Merged

Added Image.blank() #60

merged 1 commit into from Sep 19, 2012

Conversation

@pflorczyk
Copy link
Contributor

@pflorczyk pflorczyk commented Sep 18, 2012

This change is backward incompatible. It removes width, height and background from Image.__init__() in favour of new method Image.blank().

Example:

i = Image().blank(100, 100)

Not a big change but now code should be more readable and less error-prone.

@@ -46,12 +46,12 @@ def blank_image():
gray = Color('#ccc')
transparent = Color('transparent')
with raises(TypeError):
Image(height=0, filename='/test.png')
Image().blank(height=0, filename='/test.png')
Copy link
Contributor Author

@pflorczyk pflorczyk Sep 18, 2012

What to do with this ? This test passes, but filename is not an argument for blank. height=0 is tested line bellow.

Copy link
Collaborator

@dahlia dahlia Sep 18, 2012

@dahlia
Copy link
Collaborator

@dahlia dahlia commented Sep 18, 2012

I agree with this your refactoring except backward incompatible change. The constructor should have parameters for creating a new blank image, even though it internally calls Image.blank() method.

@pflorczyk
Copy link
Contributor Author

@pflorczyk pflorczyk commented Sep 19, 2012

Ok. Updated the commit.

dahlia added a commit that referenced this issue Sep 19, 2012
@dahlia dahlia merged commit 4047076 into emcconville:master Sep 19, 2012
1 check passed
@dahlia
Copy link
Collaborator

@dahlia dahlia commented Sep 19, 2012

Thanks! I merged it.

dahlia added a commit that referenced this issue Sep 19, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants