summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
diff options
context:
space:
mode:
authorDave Lerner <dave.lerner@windriver.com>2015-02-25 14:53:22 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-03-09 14:33:50 +0000
commitd8ae3ac160a0256f205908fb3f72a2a1a2a85c94 (patch)
treec498813419df24dc60beeec37582540ae926f575 /bitbake/lib/toaster/toastergui/templatetags/projecttags.py
parent4004aebb1b505967410494ed152b44eab0bf6cb4 (diff)
downloadpoky-d8ae3ac160a0256f205908fb3f72a2a1a2a85c94.tar.gz
bitbake: toaster: commit id format on layers page
On the layers page, when a layer revision is a commit id instead of a an upstream branch name, then follow the same format for displaying the commit id as on the recipes page. That format is a button with the truncated commit SHAID which when pressed expands to the full SHAID. [YOCTO #7191] (Bitbake rev: 507d2a36e53ba2c1f49616d52e4700f6c1bca8fd) Signed-off-by: Dave Lerner <dave.lerner@windriver.com> Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/templatetags/projecttags.py')
-rw-r--r--bitbake/lib/toaster/toastergui/templatetags/projecttags.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
index 276c6eb098..e66910cd9d 100644
--- a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
+++ b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
@@ -295,3 +295,15 @@ def format_build_date(completed_on):
295 295
296 if delta.days >= 1: 296 if delta.days >= 1:
297 return True 297 return True
298
299@register.filter
300def is_shaid(text):
301 """ return True if text length is 40 characters and all hex-digits
302 """
303 try:
304 int(text, 16)
305 if len(text) == 40:
306 return True
307 return False
308 except ValueError:
309 return False