Completed
Push — master ( f6be3f...655f16 )
by Jace
30s queued 11s
created

generate_sample_images.main()   A

Complexity

Conditions 5

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 5
eloc 9
nop 0
dl 0
loc 12
rs 9.3333
c 0
b 0
f 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