sugarlabs / Pippy

Pippy allows the student to examine, execute, and modify simple Python programs. In addition it is possible to write Python statements to play sounds, calculate expressions, or make simple text based interactive games.
GNU General Public License v2.0
11 stars 34 forks source link

Fix no source tab on resume of empty file #85

Closed shaansubbaiah closed 4 years ago

shaansubbaiah commented 4 years ago

The changes in read_file() adds an empty tab if there isn't any data loaded from the datastore to create tabs.

Also, when one made changes to the tab now present after the fix, it did not save. This is because the session data was empty after reading the empty source file from the datastore. If the session data is empty, the for loop that iterates through the zip in write_file() is skipped.

Fix in write_file() appends a None object to the session data if it is empty.

Reproduce: Start Pippy -> Stop Pippy -> Resume Pippy -> Source tab is missing

Fixes #67

shaansubbaiah commented 4 years ago

@quozl @chimosky @srevinsaju kindly test and review.


For some reason, today my Journal is empty irrespective of the Activity. I'll try restoring an earlier snapshot and test again.

quozl commented 4 years ago

Thanks. Reviewed. Tested.