else:
return datetime.datetime.utcnow() - self.started_at
- def add_file(self, filename):
- """
- Add the specified file to this job.
-
- The file is copied to the right directory by this function.
- """
- assert os.path.exists(filename)
-
- if filename.endswith(".%s" % PACKAGE_EXTENSION):
- # It is not allowed to upload packages on test builds.
- if self.test:
- return
-
- # Open package (creates entry in the database)
- pkg = self.backend.packages.create(filename)
-
- # Move package to the build directory.
- pkg.move(os.path.join(self.build.path, self.arch))
-
- # Attach the package to this job.
- self.db.execute("INSERT INTO jobs_packages(job_id, pkg_id) VALUES(%s, %s)",
- self.id, pkg.id)
-
@property
def message_recipients(self):
l = []