Merge lp:~phill-ridout/openlp/1012110_2.0 into lp:openlp/2.0

Proposed by Phill
Status: Superseded
Proposed branch: lp:~phill-ridout/openlp/1012110_2.0
Merge into: lp:openlp/2.0
Diff against target: 28 lines (+6/-3)
1 file modified
openlp/plugins/presentations/lib/pptviewcontroller.py (+6/-3)
To merge this branch: bzr merge lp:~phill-ridout/openlp/1012110_2.0
Reviewer Review Type Date Requested Status
Raoul Snyman Needs Fixing
Review via email: mp+189408@code.launchpad.net

This proposal has been superseded by a proposal from 2013-10-06.

Description of the change

Fixes bug #1012110 by encoding the file name with the file system encoding

To post a comment you must log in.
Revision history for this message
Raoul Snyman (raoul-snyman) wrote :

I can't test this (as I don't have Windows), but there are a few things you need to change:

On line 17 you should use os.path.normpath(), don't do a manual find and replace. See http://docs.python.org/2/library/os.path.html#os.path.normpath

On line 22 you should use os.path.join().

review: Needs Fixing
lp:~phill-ridout/openlp/1012110_2.0 updated
2171. By Phill

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

2172. By Phill

Unicodified the pptview dll.

2173. By Phill

fixes to ppttest.py

2174. By Phill

tided up pptviewcontroller and ppttest

2175. By Phill

Final touches

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp/plugins/presentations/lib/pptviewcontroller.py'
2--- openlp/plugins/presentations/lib/pptviewcontroller.py 2013-08-20 18:30:15 +0000
3+++ openlp/plugins/presentations/lib/pptviewcontroller.py 2013-10-06 08:29:05 +0000
4@@ -29,6 +29,7 @@
5
6 import os
7 import logging
8+import sys
9
10 if os.name == u'nt':
11 from ctypes import cdll
12@@ -125,11 +126,13 @@
13 renderer = self.controller.plugin.renderer
14 rect = renderer.screens.current[u'size']
15 rect = RECT(rect.x(), rect.y(), rect.right(), rect.bottom())
16- filepath = str(self.filepath.replace(u'/', u'\\'))
17+ filepath = os.path.normpath(self.filepath)
18+ preview_path = os.path.join(self.get_temp_folder(), u'slide')
19 if not os.path.isdir(self.get_temp_folder()):
20 os.makedirs(self.get_temp_folder())
21- self.pptid = self.controller.process.OpenPPT(filepath, None, rect,
22- str(self.get_temp_folder()) + '\\slide')
23+ file_system_encoding = sys.getfilesystemencoding()
24+ self.pptid = self.controller.process.OpenPPT(filepath.encode(file_system_encoding), None, rect,
25+ preview_path.encode(file_system_encoding))
26 if self.pptid >= 0:
27 self.create_thumbnails()
28 self.stop_presentation()

Subscribers

People subscribed via source and target branches