gatech-csl / jes

The Jython Environment for Students allows students to write Jython programs that can manipulate pictures, sounds, and videos.
http://mediacomputation.org/
59 stars 38 forks source link

backup files not written #91

Open ninakoch opened 8 years ago

ninakoch commented 8 years ago

I have actually found the source of this error. It happens during the writeFile method found in jes/python/jes/gui/filemanager/init.py . As the backup file is written, the open function is called with the wrong filename argument. The code looks like this:

Now write the backup

if JESConfig.getInstance().getBooleanProperty(JESConfig.CONFIG_BACKUPSAVE): try: backupPath = self.filename + "bak" with open(filename, 'w') as fd: fd.write(sourceText)

Notice that the backupPath variable is never read. The code should look like this:

Now write the backup

if JESConfig.getInstance().getBooleanProperty(JESConfig.CONFIG_BACKUPSAVE): try: backupPath = self.filename + "bak" with open(backupPath, 'w') as fd: fd.write(sourceText)

ninakoch commented 8 years ago

Sorry, indentations were lost when I submitted and for some reason the #symbol makes things turn really big!

mjguzdial commented 8 years ago

Thank you, Nina! I can figure out the indentation. I'll incorporate this change in the next version.


From: ninakoch [notifications@github.com] Sent: Sunday, September 13, 2015 2:19 PM To: gatech-csl/jes Subject: Re: [jes] backup files not written (#91)

Sorry, indentations were lost when I submitted and for some reason the #symbol makes things turn really big!

— Reply to this email directly or view it on GitHubhttps://github.com/gatech-csl/jes/issues/91#issuecomment-139901004.