update impress eval examples
This commit is contained in:
@@ -15,3 +15,4 @@ from .general import check_csv, check_accessibility_tree, check_list, run_sqlite
|
||||
from .thunderbird import check_thunderbird_prefs, check_thunderbird_filter
|
||||
from .vscode import compare_text_file, compare_config, compare_answer, is_extension_installed
|
||||
from .impress import check_slide_numbers_color, compare_pptx_files, check_for_two_lines, check_for_audio, check_formula_shape, check_file_exists
|
||||
from .impress import check_slide_orientation_Portrait, contains_mp4_video
|
||||
@@ -94,6 +94,25 @@ def check_formula_shape(prs):
|
||||
return 1
|
||||
return 0
|
||||
|
||||
def check_slide_orientation_Portrait(pptx_path):
|
||||
presentation = Presentation(pptx_path)
|
||||
|
||||
slide_height = presentation.slide_height
|
||||
slide_width = presentation.slide_width
|
||||
|
||||
if slide_width < slide_height:
|
||||
return 1
|
||||
return 0
|
||||
|
||||
def contains_mp4_video(pptx_path):
|
||||
prs = Presentation(pptx_path)
|
||||
for slide in prs.slides:
|
||||
for shape in slide.shapes:
|
||||
if shape.shape_type == 16:
|
||||
if shape.media_type == 3:
|
||||
return 1
|
||||
return 0
|
||||
|
||||
if __name__ == "__main__":
|
||||
path1 = "../../任务数据/LibreOffice Impress/Change_Color_Slide_Number_gold_textbox.pptx"
|
||||
presentation = Presentation(path1)
|
||||
|
||||
Reference in New Issue
Block a user