summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/orm/models.py
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2016-02-23 12:17:04 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-26 17:20:28 +0000
commit98d462c8e67e292188f2614a3cc9db6136320351 (patch)
tree2375759d5a3bd601336cb0e880511c4f59ab6f58 /bitbake/lib/toaster/orm/models.py
parent88b56603ce18337ac3c31185ae6ee90e9551c2ae (diff)
downloadpoky-98d462c8e67e292188f2614a3cc9db6136320351.tar.gz
bitbake: toaster: show suffix for image files and basename for artifact files
The build dashboard doesn't show image and artifact files correctly, as it shows the full filename for images and the filename plus path relative to DEPLOY_DIR for artifacts. Instead, show just the suffix for image files, and the basename for artifact files. (Bitbake rev: 8084dcdc283b4dc170f066c202f89d56ce1abbef) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/orm/models.py')
-rw-r--r--bitbake/lib/toaster/orm/models.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index ab6940feaf..93b5df3d4e 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -550,6 +550,8 @@ class BuildArtifact(models.Model):
550 550
551 return self.file_name 551 return self.file_name
552 552
553 def get_basename(self):
554 return os.path.basename(self.file_name)
553 555
554 def is_available(self): 556 def is_available(self):
555 return self.build.buildrequest.environment.has_artifact(self.file_name) 557 return self.build.buildrequest.environment.has_artifact(self.file_name)
@@ -588,6 +590,12 @@ class Target_Image_File(models.Model):
588 file_name = models.FilePathField(max_length=254) 590 file_name = models.FilePathField(max_length=254)
589 file_size = models.IntegerField() 591 file_size = models.IntegerField()
590 592
593 @property
594 def suffix(self):
595 filename, suffix = os.path.splitext(self.file_name)
596 suffix = suffix.lstrip('.')
597 return suffix
598
591class Target_File(models.Model): 599class Target_File(models.Model):
592 ITYPE_REGULAR = 1 600 ITYPE_REGULAR = 1
593 ITYPE_DIRECTORY = 2 601 ITYPE_DIRECTORY = 2