forked from openlp/openlp
pep8 fixes
This commit is contained in:
parent
e1c00f9689
commit
b6cd13fc91
@ -32,7 +32,6 @@ This module is for controlling powerpoint. PPT API documentation:
|
|||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
#from .ppinterface import constants
|
|
||||||
|
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
from win32com.client import Dispatch
|
from win32com.client import Dispatch
|
||||||
|
@ -178,7 +178,6 @@ class PptviewDocument(PresentationDocument):
|
|||||||
with zip_file.open('ppt/presentation.xml') as pres:
|
with zip_file.open('ppt/presentation.xml') as pres:
|
||||||
tree = ElementTree.parse(pres)
|
tree = ElementTree.parse(pres)
|
||||||
nodes = tree.getroot().findall(".//p:sldIdLst/p:sldId", namespaces=namespaces)
|
nodes = tree.getroot().findall(".//p:sldIdLst/p:sldId", namespaces=namespaces)
|
||||||
#print("slide count: " + str(len(nodes)))
|
|
||||||
# initialize the lists
|
# initialize the lists
|
||||||
titles = ['' for i in range(len(nodes))]
|
titles = ['' for i in range(len(nodes))]
|
||||||
notes = ['' for i in range(len(nodes))]
|
notes = ['' for i in range(len(nodes))]
|
||||||
|
@ -395,7 +395,7 @@ class HttpRouter(RegistryProperties):
|
|||||||
if controller_name and file_name:
|
if controller_name and file_name:
|
||||||
if controller_name in supported_controllers:
|
if controller_name in supported_controllers:
|
||||||
full_path = urllib.parse.unquote(file_name)
|
full_path = urllib.parse.unquote(file_name)
|
||||||
if not '..' in full_path: # no hacking please
|
if '..' not in full_path: # no hacking please
|
||||||
full_path = os.path.normpath(os.path.join(AppLocation.get_section_data_path(controller_name),
|
full_path = os.path.normpath(os.path.join(AppLocation.get_section_data_path(controller_name),
|
||||||
'thumbnails/' + full_path))
|
'thumbnails/' + full_path))
|
||||||
if os.path.exists(full_path):
|
if os.path.exists(full_path):
|
||||||
|
@ -103,7 +103,6 @@ class TestImageManager(TestCase, TestMixin):
|
|||||||
|
|
||||||
# THEN: The return should be of type image
|
# THEN: The return should be of type image
|
||||||
self.assertEqual(isinstance(image, QtGui.QImage), True, 'The returned object should be a QImage')
|
self.assertEqual(isinstance(image, QtGui.QImage), True, 'The returned object should be a QImage')
|
||||||
#print(len(self.image_manager._cache))
|
|
||||||
|
|
||||||
# WHEN: adding the same image with different dimensions
|
# WHEN: adding the same image with different dimensions
|
||||||
self.image_manager.add_image(full_path, 'church.jpg', None, '100x100')
|
self.image_manager.add_image(full_path, 'church.jpg', None, '100x100')
|
||||||
|
@ -255,7 +255,6 @@ class TestPptviewDocument(TestCase):
|
|||||||
with patch('builtins.open') as mocked_open, \
|
with patch('builtins.open') as mocked_open, \
|
||||||
patch('openlp.plugins.presentations.lib.pptviewcontroller.zipfile.is_zipfile') as mocked_is_zf:
|
patch('openlp.plugins.presentations.lib.pptviewcontroller.zipfile.is_zipfile') as mocked_is_zf:
|
||||||
mocked_is_zf.return_value = False
|
mocked_is_zf.return_value = False
|
||||||
#mocked_exists.return_value = True
|
|
||||||
mocked_open.filesize = 10
|
mocked_open.filesize = 10
|
||||||
doc = PptviewDocument(self.mock_controller, self.mock_presentation)
|
doc = PptviewDocument(self.mock_controller, self.mock_presentation)
|
||||||
doc.file_path = os.path.join(TEST_RESOURCES_PATH, 'presentations', 'test.ppt')
|
doc.file_path = os.path.join(TEST_RESOURCES_PATH, 'presentations', 'test.ppt')
|
||||||
|
Loading…
Reference in New Issue
Block a user