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

scripts.generate_sample_images   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 5

1 Function

Rating   Name   Duplication   Size   Complexity  
A main() 0 12 5
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