Refactored to use os.path.normpath and os.path.join

This commit is contained in:
Philip Ridout 2013-10-06 09:28:03 +01:00
parent 1cf4b8f4ce
commit a7a51a2ff6

View File

@ -126,10 +126,10 @@ class PptviewDocument(PresentationDocument):
renderer = self.controller.plugin.renderer
rect = renderer.screens.current[u'size']
rect = RECT(rect.x(), rect.y(), rect.right(), rect.bottom())
filepath = self.filepath.replace(u'/', u'\\')
filepath = os.path.normpath(self.filepath)
preview_path = os.path.join(self.get_temp_folder(), u'slide')
if not os.path.isdir(self.get_temp_folder()):
os.makedirs(self.get_temp_folder())
preview_path = self.get_temp_folder() + u'\\slide'
file_system_encoding = sys.getfilesystemencoding()
self.pptid = self.controller.process.OpenPPT(filepath.encode(file_system_encoding), None, rect,
preview_path.encode(file_system_encoding))