update PPTC examples into impress
This commit is contained in:
@@ -148,7 +148,8 @@ def compare_pptx_files(file1_path, file2_path, **options):
|
||||
examine_alignment = options.get("examine_alignment", True)
|
||||
examine_bottom_position = options.get("examine_bottom_position", False)
|
||||
examine_right_position = options.get("examine_right_position", False)
|
||||
examine_image_size = options.get("examine_image_size", True)
|
||||
examine_image_size = options.get("examine_image_size", False)
|
||||
examine_modify_height = options.get("examine_modify_height", False)
|
||||
examine_bullets = options.get("examine_bullets", True)
|
||||
examine_background_color = options.get("examine_background_color", True)
|
||||
examine_note = options.get("examine_note", True)
|
||||
@@ -182,12 +183,18 @@ def compare_pptx_files(file1_path, file2_path, **options):
|
||||
for shape1, shape2 in zip(slide1.shapes, slide2.shapes):
|
||||
if examine_bottom_position and shape1.top != shape2.top:
|
||||
if hasattr(shape1, "text") and hasattr(shape2, "text") and shape1.text == shape2.text and shape1.text == "Product Comparison":
|
||||
if shape1.top >= shape2.top:
|
||||
if shape1.top <= shape2.top:
|
||||
return 0
|
||||
elif shape1.shape_type == 19 and shape2.shape_type == 19:
|
||||
if shape1.top <= shape2.top:
|
||||
return 0
|
||||
elif shape1.left != shape2.left or shape1.top != shape2.top or shape1.width != shape2.width or shape1.height != shape2.height:
|
||||
return 0
|
||||
|
||||
|
||||
if examine_right_position and shape1.left != shape2.left:
|
||||
if not hasattr(shape1, "text") and not hasattr(shape2, "text"):
|
||||
if shape1.left >= shape2.left:
|
||||
if shape1.left <= shape2.left:
|
||||
return 0
|
||||
|
||||
if (shape1.left != shape2.left or shape1.top != shape2.top or shape1.width != shape2.width or shape1.height != shape2.height) and examine_shape:
|
||||
@@ -199,6 +206,11 @@ def compare_pptx_files(file1_path, file2_path, **options):
|
||||
return 0
|
||||
elif shape1.left != shape2.left or shape1.top != shape2.top or shape1.width != shape2.width or shape1.height != shape2.height:
|
||||
return 0
|
||||
|
||||
if examine_modify_height:
|
||||
if shape1.shape_type == 13 and shape2.shape_type == 13:
|
||||
if shape1.height != shape2.height:
|
||||
return 0
|
||||
|
||||
if hasattr(shape1, "text") and hasattr(shape2, "text"):
|
||||
if shape1.text != shape2.text and examine_text:
|
||||
|
||||
Reference in New Issue
Block a user