(settings: str = "*")
| 152 | |
| 153 | |
| 154 | def pptx2images(settings: str = "*"): |
| 155 | while True: |
| 156 | for folder in glob(f"data/*/pptx/*/{settings}/*/history"): |
| 157 | folder = os.path.dirname(folder) |
| 158 | pptx = pjoin(folder, "final.pptx") |
| 159 | ppt_folder, setting, pdf = folder.rsplit("/", 2) |
| 160 | dst = pjoin(ppt_folder, "final_images", setting, pdf) |
| 161 | |
| 162 | if not pexists(pptx): |
| 163 | if pexists(dst): |
| 164 | print(f"remove {dst}") |
| 165 | shutil.rmtree(dst) |
| 166 | continue |
| 167 | |
| 168 | older_than(pptx) |
| 169 | if pexists(dst): |
| 170 | continue |
| 171 | try: |
| 172 | ppt_to_images(pptx, dst) |
| 173 | except: |
| 174 | print("pptx to images failed") |
| 175 | sleep(60) |
| 176 | print("keep scanning for new pptx") |
| 177 | |
| 178 | |
| 179 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected