forked from openlp/openlp
pep8 fixes
This commit is contained in:
parent
52f298fdc1
commit
98a58d45bf
|
@ -431,6 +431,7 @@ class PowerpointDocument(PresentationDocument):
|
|||
'and the presentation will be stopped. '
|
||||
'Restart the presentation if you wish to present it.'))
|
||||
|
||||
|
||||
def _get_text_from_shapes(shapes):
|
||||
"""
|
||||
Returns any text extracted from the shapes on a presentation slide.
|
||||
|
@ -447,6 +448,7 @@ def _get_text_from_shapes(shapes):
|
|||
if os.name == "nt":
|
||||
try:
|
||||
ppE = win32com.client.getevents("PowerPoint.Application")
|
||||
|
||||
class PowerpointEvents(ppE):
|
||||
def OnSlideShowBegin(self, hwnd):
|
||||
#print("SS Begin")
|
||||
|
@ -470,4 +472,3 @@ if os.name == "nt":
|
|||
return
|
||||
except pywintypes.com_error:
|
||||
log.debug('COM error trying to get powerpoint events - powerpoint is probably not installed.')
|
||||
|
||||
|
|
|
@ -296,8 +296,7 @@ class PresentationDocument(object):
|
|||
def get_titles_and_notes(self):
|
||||
"""
|
||||
Reads the titles from the titles file and
|
||||
the notes files and returns the contents
|
||||
in a two lists
|
||||
the notes files and returns the content in two lists
|
||||
"""
|
||||
titles = []
|
||||
notes = []
|
||||
|
@ -337,6 +336,7 @@ class PresentationDocument(object):
|
|||
with open(notes_file, mode='w') as fn:
|
||||
fn.write(note)
|
||||
|
||||
|
||||
class PresentationController(object):
|
||||
"""
|
||||
This class is used to control interactions with presentation applications by creating a runtime environment.
|
||||
|
@ -471,6 +471,7 @@ class PresentationController(object):
|
|||
def close_presentation(self):
|
||||
pass
|
||||
|
||||
|
||||
class TextType(object):
|
||||
"""
|
||||
Type Enumeration for Types of Text to request
|
||||
|
@ -478,4 +479,3 @@ class TextType(object):
|
|||
Title = 0
|
||||
SlideText = 1
|
||||
Notes = 2
|
||||
|
||||
|
|
|
@ -627,4 +627,3 @@ class HttpRouter(RegistryProperties):
|
|||
item_id = plugin.media_item.create_item_from_id(request_id)
|
||||
plugin.media_item.emit(QtCore.SIGNAL('%s_add_to_service' % plugin_name), [item_id, True])
|
||||
self.do_http_success()
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ from openlp.plugins.presentations.lib.impresscontroller import \
|
|||
|
||||
TEST_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..', 'resources'))
|
||||
|
||||
|
||||
class TestLibModule(TestCase):
|
||||
|
||||
def setUp(self):
|
||||
|
|
|
@ -40,6 +40,7 @@ from openlp.plugins.presentations.lib.pptviewcontroller import PptviewController
|
|||
|
||||
TEST_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..', 'resources'))
|
||||
|
||||
|
||||
class TestLibModule(TestCase):
|
||||
|
||||
def setUp(self):
|
||||
|
@ -148,4 +149,3 @@ class TestLibModule(TestCase):
|
|||
# THEN:
|
||||
self.doc.save_titles_and_notes.assert_called_once_with(None, None)
|
||||
self.assertEqual(mocked_is_zf.call_count, 1, 'is_zipfile should have been called once')
|
||||
|
||||
|
|
|
@ -37,18 +37,17 @@ from tests.functional import MagicMock, patch, mock_open
|
|||
|
||||
FOLDER_TO_PATCH = 'openlp.plugins.presentations.lib.presentationcontroller.PresentationDocument.get_thumbnail_folder'
|
||||
|
||||
|
||||
class TestPresentationController(TestCase):
|
||||
"""
|
||||
Test the PresentationController.
|
||||
"""
|
||||
|
||||
def setUp(self):
|
||||
mocked_plugin = MagicMock()
|
||||
mocked_plugin.settings_section = 'presentations'
|
||||
self.presentation = PresentationController(mocked_plugin)
|
||||
self.document = PresentationDocument(self.presentation, '')
|
||||
|
||||
|
||||
def constructor_test(self):
|
||||
"""
|
||||
Test the Constructor
|
||||
|
@ -100,7 +99,6 @@ class TestPresentationController(TestCase):
|
|||
# THEN: No file should have been created
|
||||
self.assertEqual(mocked_open.call_count, 0, 'No file should be created')
|
||||
|
||||
|
||||
def get_titles_and_notes_test(self):
|
||||
"""
|
||||
Test PresentationDocument.get_titles_and_notes method
|
||||
|
@ -166,4 +164,3 @@ class TestPresentationController(TestCase):
|
|||
|
||||
# THEN: it should return two empty lists
|
||||
self.assertIs(type(result_titles), list, 'result_titles should be a list')
|
||||
|
||||
|
|
Loading…
Reference in New Issue