| Total Complexity | 5 | 
| Total Lines | 26 | 
| Duplicated Lines | 0 % | 
| Changes | 0 | ||
| 1 | #!env/bin/python  | 
            ||
| 2 | |||
| 3 | import log  | 
            ||
| 4 | |||
| 5 | from memegen.settings import ProductionConfig  | 
            ||
| 6 | from memegen.factory import create_app  | 
            ||
| 7 | from memegen.domain import Text  | 
            ||
| 8 | |||
| 9 | |||
| 10 | def main():  | 
            ||
| 11 |     log.info("Generating sample images...") | 
            ||
| 12 | |||
| 13 | app = create_app(ProductionConfig)  | 
            ||
| 14 | |||
| 15 | with app.app_context():  | 
            ||
| 16 | |||
| 17 | for template in app.template_service.all():  | 
            ||
| 18 |             for text in [Text("_"), template.sample_text]: | 
            ||
| 19 | for watermark in ["", "memegen.link"]:  | 
            ||
| 20 | app.image_service.create(template, text,  | 
            ||
| 21 | watermark=watermark)  | 
            ||
| 22 | |||
| 23 | |||
| 24 | if __name__ == '__main__':  | 
            ||
| 25 | main()  | 
            ||
| 26 |