summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2015-02-06 15:32:18 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-02-10 23:07:48 +0000
commitd81e5141c10a97bf5764892f9b20933b751c1da3 (patch)
tree64a82acb15fe06a8a23e9618ff6a8eb18f604513 /bitbake
parentda8110a86ad8b57b8c41873d40aeac346ee66b88 (diff)
downloadast2050-yocto-poky-d81e5141c10a97bf5764892f9b20933b751c1da3.zip
ast2050-yocto-poky-d81e5141c10a97bf5764892f9b20933b751c1da3.tar.gz
bitbake: toaster: display Toaster mode and version in debug mode
This patch displays the current running mode and checked-out git branch as Toaster version when running in debug mode. (Bitbake rev: 93e4f8c44273f4657c5be4c00b61db12aa875e31) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/toaster/toastergui/static/css/default.css19
-rw-r--r--bitbake/lib/toaster/toastergui/templates/base.html6
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py8
-rw-r--r--bitbake/lib/toaster/toastermain/settings.py5
4 files changed, 34 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/css/default.css b/bitbake/lib/toaster/toastergui/static/css/default.css
index 1095254..a866773 100644
--- a/bitbake/lib/toaster/toastergui/static/css/default.css
+++ b/bitbake/lib/toaster/toastergui/static/css/default.css
@@ -2,6 +2,25 @@
.logo img { height: 30px; width: auto !important; }
.logo { padding-top: 4px !important; padding-bottom:0px !important; }
+/* style the version text */
+.version-text {
+ color: #AAA;
+ font-size: 0.6em;
+ display: table-footer-group;
+ padding: 0px;
+ margin: 1px 1px 1px 1px;
+}
+
+.version-brand, .version-brand:hover, a.version-brand:focus {
+ color: #777;
+ display: block;
+ float: left;
+ font-size: 20px;
+ font-weight: 200;
+ padding: 00px 0px;
+ text-shadow: 0 1px 0 #fff;
+}
+
/* Style the breadcrumb */
.breadcrumb { display: inline-block; background-color: transparent; }
.section { margin: 20px 0; }
diff --git a/bitbake/lib/toaster/toastergui/templates/base.html b/bitbake/lib/toaster/toastergui/templates/base.html
index e95b5e0..6f249bc 100644
--- a/bitbake/lib/toaster/toastergui/templates/base.html
+++ b/bitbake/lib/toaster/toastergui/templates/base.html
@@ -59,6 +59,12 @@
<div class="navbar-inner">
<a class="brand logo" href="#"><img src="{% static 'img/logo.png' %}" class="" alt="Yocto logo project"/></a>
<a class="brand" href="/">Toaster</a>
+ {% if DEBUG %}
+ <div style="display: inline;" class="version-brand">
+ <p class="version-text">version {{TOASTER_VERSION}}</p>
+ <p class="version-text">{%if MANAGED%}managed{%else%}interactive{%endif%} mode</p>
+ </div>
+ {% endif %}
<a class="pull-right manual" target="_blank" href="http://www.yoctoproject.org/documentation/toaster-manual">
<i class="icon-book"></i>
Toaster manual
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index b67a676..4b770ff 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -1709,10 +1709,12 @@ if toastermain.settings.MANAGED:
# the context processor that supplies data used across all the pages
def managedcontextprocessor(request):
+ import subprocess
ret = {
"projects": Project.objects.all(),
"MANAGED" : toastermain.settings.MANAGED,
- "DEBUG" : toastermain.settings.DEBUG
+ "DEBUG" : toastermain.settings.DEBUG,
+ "TOASTER_VERSION": toastermain.settings.TOASTER_VERSION,
}
if 'project_id' in request.session:
try:
@@ -3057,7 +3059,9 @@ else:
return {
"projects": [],
"MANAGED" : toastermain.settings.MANAGED,
- "DEBUG" : toastermain.settings.DEBUG
+ "DEBUG" : toastermain.settings.DEBUG,
+ "TOASTER_VERSION": toastermain.settings.TOASTER_VERSION,
+
}
diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py
index ea7c353..b6a42c0 100644
--- a/bitbake/lib/toaster/toastermain/settings.py
+++ b/bitbake/lib/toaster/toastermain/settings.py
@@ -211,8 +211,6 @@ MIDDLEWARE_CLASSES = (
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
- 'django.middleware.cache.UpdateCacheMiddleware',
- 'django.middleware.cache.FetchFromCacheMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
@@ -233,6 +231,9 @@ CACHES = {
from os.path import dirname as DN
SITE_ROOT=DN(DN(os.path.abspath(__file__)))
+import subprocess
+TOASTER_VERSION = subprocess.Popen('cd %s; git branch | grep "^* " | tr -d "* "' % SITE_ROOT, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0]
+
ROOT_URLCONF = 'toastermain.urls'
# Python dotted path to the WSGI application used by Django's runserver.
OpenPOWER on IntegriCloud