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 logging
|
||||
#from .ppinterface import constants
|
||||
|
||||
if os.name == 'nt':
|
||||
from win32com.client import Dispatch
|
||||
|
@ -178,7 +178,6 @@ class PptviewDocument(PresentationDocument):
|
||||
with zip_file.open('ppt/presentation.xml') as pres:
|
||||
tree = ElementTree.parse(pres)
|
||||
nodes = tree.getroot().findall(".//p:sldIdLst/p:sldId", namespaces=namespaces)
|
||||
#print("slide count: " + str(len(nodes)))
|
||||
# initialize the lists
|
||||
titles = ['' 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 in supported_controllers:
|
||||
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),
|
||||
'thumbnails/' + full_path))
|
||||
if os.path.exists(full_path):
|
||||
|
@ -103,7 +103,6 @@ class TestImageManager(TestCase, TestMixin):
|
||||
|
||||
# THEN: The return should be of type image
|
||||
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
|
||||
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, \
|
||||
patch('openlp.plugins.presentations.lib.pptviewcontroller.zipfile.is_zipfile') as mocked_is_zf:
|
||||
mocked_is_zf.return_value = False
|
||||
#mocked_exists.return_value = True
|
||||
mocked_open.filesize = 10
|
||||
doc = PptviewDocument(self.mock_controller, self.mock_presentation)
|
||||
doc.file_path = os.path.join(TEST_RESOURCES_PATH, 'presentations', 'test.ppt')
|
||||
|
@ -136,7 +136,7 @@ class TestPresentationController(TestCase):
|
||||
mocked_get_thumbnail_folder.return_value = 'test'
|
||||
mocked_exists.return_value = False
|
||||
|
||||
#WHEN: calling get_titles_and_notes
|
||||
# WHEN: calling get_titles_and_notes
|
||||
result_titles, result_notes = self.document.get_titles_and_notes()
|
||||
|
||||
# THEN: it should return two empty lists
|
||||
|
Loading…
Reference in New Issue
Block a user