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