~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/services/job/runner.py

[r=allenap][no-qa] Add
 PlainPackageCopyJob.getIncompleteJobsForArchive() method which will return
 all the WAITING, RUNNING or FAILED copy jobs for the passed archive.

Show diffs side-by-side

added added

removed removed

Lines of Context:
101
101
    # We redefine __eq__ and __ne__ here to prevent the security proxy
102
102
    # from mucking up our comparisons in tests and elsewhere.
103
103
    def __eq__(self, job):
 
104
        naked_job = removeSecurityProxy(job)
104
105
        return (
105
 
            self.__class__ is removeSecurityProxy(job.__class__)
106
 
            and self.job == job.job)
 
106
            self.__class__ is naked_job.__class__ and
 
107
            self.__dict__ == naked_job.__dict__)
107
108
 
108
109
    def __ne__(self, job):
109
110
        return not (self == job)
110
111
 
 
112
    def __lt__(self, job):
 
113
        naked_job = removeSecurityProxy(job)
 
114
        if self.__class__ is naked_job.__class__:
 
115
            return self.__dict__ < naked_job.__dict__
 
116
        else:
 
117
            return NotImplemented
 
118
 
111
119
    def getOopsRecipients(self):
112
120
        """Return a list of email-ids to notify about oopses."""
113
121
        return self.getErrorRecipients()