Skip to content

Commit

Permalink
Make Project.thumbnail an Image, not a Costume.
Browse files Browse the repository at this point in the history
This is a *mostly* backwards-compatible change.
  • Loading branch information
tjvr committed Oct 2, 2013
1 parent c1ce11f commit 8c417ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions kurt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def __init__(self):
""":class:`dict` of global :class:`Lists <List>` by name."""

self.thumbnail = None
"""A screenshot of the project. May be displayed in project browser."""
"""An :class:`Image` with a screenshot of the project."""

self.tempo = 60
"""The tempo in BPM used for note blocks."""
Expand Down Expand Up @@ -305,7 +305,7 @@ def copy(self):

p.variables = dict((n, v.copy()) for (n, v) in self.variables.items())
p.lists = dict((n, l.copy()) for (n, l) in self.lists.items())
p.thumbnail = self.thumbnail.copy() if self.thumbnail else None
p.thumbnail = self.thumbnail
p.tempo = self.tempo
p.notes = self.notes
p.author = self.author
Expand Down
5 changes: 3 additions & 2 deletions kurt/scratch14/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def load(self, fp):
name = 'thumbnail',
form = thumbnail,
)
self.project.thumbnail = self.load_image(thumbnail)
self.project.thumbnail = self.load_image(thumbnail).image

# stage
self.load_scriptable(self.project.stage, self.stage)
Expand Down Expand Up @@ -149,7 +149,8 @@ def save(self, fp, project):
self.stage = self.UserObject("ScratchStageMorph")

# project info
thumbnail = self.save_image(self.project.thumbnail)
thumbnail = self.save_image(
kurt.Costume("thumbnail", self.project.thumbnail))
self.info = {
'author': self.project.author,
'comment': self.project.notes.replace("\n", "\r"),
Expand Down

0 comments on commit 8c417ff

Please sign in to comment.