weblate/examples/benchmark
Michal Čihař 7026d805a0 Rename SubProject model to Component
It is already labeled as Component in most places, the model has kept
old name for historical reasons.

Issue #1820

Signed-off-by: Michal Čihař <michal@cihar.com>
2018-04-18 07:53:33 +02:00

17 lines
890 B
Text

# Python commands used for benchmarking
from weblate.trans.models import Component, Project
import cProfile
profiler = cProfile.Profile()
project = Project.objects.get(slug='test')
component = Component.objects.create(name='Benchmark', slug='benchmark', repo='weblate://test/android', filemask='po/*.po', project=project)
component = profiler.runcall(Component.objects.create, name='Benchmark', slug='benchmark', repo='weblate://test/android', filemask='po/*.po', project=project)
Component.objects.filter(slug='benchmark').delete()
component = profiler.runcall(Component.objects.create, name='Benchmark', slug='benchmark', repo='weblate://phpmyadmin/master', filemask='po/*.po', project=project)
component = profiler.runcall(Component.objects.create, name='Benchmark', slug='benchmark', repo='weblate://weblate/master', filemask='locale/*/LC_MESSAGES/djangojs.po', project=project)