| Conditions | 6 |
| Total Lines | 13 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | """Prerender common images used in the application.""" |
||
| 10 | async def generate_sample_images(): |
||
| 11 | app = create_app(ProductionConfig) |
||
| 12 | async with app.app_context(): |
||
| 13 | |||
| 14 | options = [] |
||
| 15 | for template in app.template_service.all(): |
||
| 16 | for text in [Text("_"), template.sample_text]: |
||
| 17 | for watermark in ["", "memegen.link"]: |
||
| 18 | options.append((template, text, watermark)) |
||
| 19 | |||
| 20 | print(f"Generating {len(options)} sample images...") |
||
| 21 | for template, text, watermark in options: |
||
| 22 | app.image_service.create(template, text, watermark=watermark) |
||
| 23 | |||
| 27 |