~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/translations/model/translationpackagingjob.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-08-01 19:34:35 UTC
  • mfrom: (13555.8.7 bug-814580-pre-cleanup)
  • Revision ID: launchpad@pqm.canonical.com-20110801193435-rhqwbist7u1jylnc
[r=henninge][bug=814580][incr] Rename PackagingJob to
        TranslationSharingJob to better reflect the purpose of the job
        and to prepare for introducing per-template sharing
        splitting/merging jobs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
from lp.translations.interfaces.translationpackagingjob import (
32
32
    ITranslationPackagingJobSource,
33
33
    )
34
 
from lp.registry.model.packagingjob import (
35
 
    PackagingJob,
36
 
    PackagingJobDerived,
37
 
    PackagingJobType,
 
34
from lp.translations.model.translationsharingjob import (
 
35
    TranslationSharingJob,
 
36
    TranslationSharingJobDerived,
 
37
    TranslationSharingJobType,
38
38
    )
39
39
from lp.translations.translationmerger import (
40
40
    TransactionManager,
43
43
from lp.translations.utilities.translationsplitter import TranslationSplitter
44
44
 
45
45
 
46
 
class TranslationPackagingJob(PackagingJobDerived, BaseRunnableJob):
 
46
class TranslationPackagingJob(TranslationSharingJobDerived, BaseRunnableJob):
47
47
    """Iterate through all Translation job types."""
48
48
 
49
49
    classProvides(ITranslationPackagingJobSource)
52
52
 
53
53
    @staticmethod
54
54
    def _register_subclass(cls):
55
 
        PackagingJobDerived._register_subclass(cls)
 
55
        TranslationSharingJobDerived._register_subclass(cls)
56
56
        job_type = getattr(cls, 'class_job_type', None)
57
57
        if job_type is not None:
58
58
            cls._translation_packaging_job_types.append(job_type)
71
71
    @classmethod
72
72
    def iterReady(cls):
73
73
        """See `IJobSource`."""
74
 
        clause = PackagingJob.job_type.is_in(
 
74
        clause = TranslationSharingJob.job_type.is_in(
75
75
            cls._translation_packaging_job_types)
76
76
        return super(TranslationPackagingJob, cls).iterReady([clause])
77
77
 
81
81
 
82
82
    implements(IRunnableJob)
83
83
 
84
 
    class_job_type = PackagingJobType.TRANSLATION_MERGE
 
84
    class_job_type = TranslationSharingJobType.PACKAGING_MERGE
85
85
 
86
86
    create_on_event = IObjectCreatedEvent
87
87
 
102
102
 
103
103
 
104
104
class TranslationSplitJob(TranslationPackagingJob):
105
 
    """Job for merging translations between a product and sourcepackage."""
 
105
    """Job for splitting translations between a product and sourcepackage."""
106
106
 
107
107
    implements(IRunnableJob)
108
108
 
109
 
    class_job_type = PackagingJobType.TRANSLATION_SPLIT
 
109
    class_job_type = TranslationSharingJobType.PACKAGING_SPLIT
110
110
 
111
111
    create_on_event = IObjectDeletedEvent
112
112