← Back to team overview

openshot.code team mailing list archive

[Branch ~openshot.code/openshot/main] Rev 644: Added a check to test the user has write permissions to the export folder, otherwise libavformat ...

 

------------------------------------------------------------
revno: 644
fixes bug: https://launchpad.net/bugs/672483
committer: Andy Finch <we.rocked.in79@xxxxxxxxx>
branch nick: openshot
timestamp: Tue 2012-03-20 22:23:06 +0000
message:
  Added a check to test the user has write permissions to the export folder, otherwise libavformat crashes.
modified:
  openshot/windows/ExportVideo.py


--
lp:openshot
https://code.launchpad.net/~openshot.code/openshot/main

Your team OpenShot Code is subscribed to branch lp:openshot.
To unsubscribe from this branch go to https://code.launchpad.net/~openshot.code/openshot/main/+edit-subscription
=== modified file 'openshot/windows/ExportVideo.py'
--- openshot/windows/ExportVideo.py	2012-01-05 21:25:13 +0000
+++ openshot/windows/ExportVideo.py	2012-03-20 22:23:06 +0000
@@ -737,13 +737,19 @@
 			folder1 = self.render_options["folder"]
 			file1 = self.render_options["file"]
 			self.export_path = "%s.%s" % (os.path.join(folder1, file1), self.render_options["f"])
+			
+			#check we have write access to the export folder, otherwise avformat will crash
+			if os.access(folder1, os.W_OK):
 
-			#check for existing filename before export and confirm overwrite
-			if os.path.exists(self.export_path) and export_type == _("Export to Folder"):
-				messagebox.show(_("Confirm Overwrite"), _("There is already a video file named %s.%s in the selected export folder. Would you like to overwrite it?") % (file1, self.render_options["f"]), gtk.BUTTONS_YES_NO, self.confirm_overwrite_yes)
+				#check for existing filename before export and confirm overwrite
+				if os.path.exists(self.export_path) and export_type == _("Export to Folder"):
+					messagebox.show(_("Confirm Overwrite"), _("There is already a video file named %s.%s in the selected export folder. Would you like to overwrite it?") % (file1, self.render_options["f"]), gtk.BUTTONS_YES_NO, self.confirm_overwrite_yes)
+				else:
+					# no existing file, so export now
+					self.do_export()
+			
 			else:
-				# no existing file, so export now
-				self.do_export()
+				messagebox.show(_("OpenShot Error"), _("You do not have write permissions to the selected folder, please select another location."))
 
 	def do_export(self):