bitbake: toaster: remove usage of BUILD_MODE variable
As both modes can be used at the same time we can't have any difference in UI between modes. Removed all conditional statements that used BUILD_MODE. (Bitbake rev: 4ce1559c2558bd0fd278ff02a1a93bec03c4156b) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
990289511b
commit
4c1e5ec29a
|
@ -79,7 +79,7 @@
|
||||||
<i class="icon-info-sign" title="<strong>Toaster version information</strong>" data-content="<dl><dt>Branch</dt><dd>{{TOASTER_BRANCH}}</dd><dt>Revision</dt><dd>{{TOASTER_REVISION}}</dd></dl>"></i>
|
<i class="icon-info-sign" title="<strong>Toaster version information</strong>" data-content="<dl><dt>Branch</dt><dd>{{TOASTER_BRANCH}}</dd><dt>Revision</dt><dd>{{TOASTER_REVISION}}</dd></dl>"></i>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</span>
|
</span>
|
||||||
{% if BUILD_MODE and request.resolver_match.url_name != 'landing' and request.resolver_match.url_name != 'newproject' %}
|
{% if request.resolver_match.url_name != 'landing' and request.resolver_match.url_name != 'newproject' %}
|
||||||
<ul class="nav">
|
<ul class="nav">
|
||||||
<li {% if request.resolver_match.url_name == 'all-builds' %}
|
<li {% if request.resolver_match.url_name == 'all-builds' %}
|
||||||
class="active"
|
class="active"
|
||||||
|
@ -108,13 +108,6 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<span class="pull-right divider-vertical"></span>
|
<span class="pull-right divider-vertical"></span>
|
||||||
|
|
||||||
<!-- new project button; only show in build mode -->
|
|
||||||
{% if BUILD_MODE %}
|
|
||||||
<div class="btn-group pull-right">
|
|
||||||
<a class="btn" id="new-project-button" href="{% url 'newproject' %}">New project</a>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -6,9 +6,6 @@
|
||||||
|
|
||||||
{% block title %} Welcome to Toaster {% endblock %}
|
{% block title %} Welcome to Toaster {% endblock %}
|
||||||
{% block pagecontent %}
|
{% block pagecontent %}
|
||||||
|
|
||||||
{% if BUILD_MODE %}
|
|
||||||
<!-- build mode -->
|
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="hero-unit span12 well-transparent">
|
<div class="hero-unit span12 well-transparent">
|
||||||
|
@ -62,11 +59,4 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
|
||||||
<!-- analysis mode -->
|
|
||||||
<div class="alert alert-info lead top-air">
|
|
||||||
Toaster has not recorded any builds yet. Run a build from the command line to see it here.
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -45,10 +45,6 @@ import string
|
||||||
PROJECT_NAME = "test project"
|
PROJECT_NAME = "test project"
|
||||||
CLI_BUILDS_PROJECT_NAME = 'Command line builds'
|
CLI_BUILDS_PROJECT_NAME = 'Command line builds'
|
||||||
|
|
||||||
# by default, tests are run in build mode; to run in analysis mode,
|
|
||||||
# set this to False in individual test cases
|
|
||||||
toastermain.settings.BUILD_MODE = True
|
|
||||||
|
|
||||||
class ViewTests(TestCase):
|
class ViewTests(TestCase):
|
||||||
"""Tests to verify view APIs."""
|
"""Tests to verify view APIs."""
|
||||||
|
|
||||||
|
|
|
@ -76,10 +76,6 @@ def landing(request):
|
||||||
default_project = Project.objects.get_default_project()
|
default_project = Project.objects.get_default_project()
|
||||||
default_project_builds = Build.objects.filter(project = default_project)
|
default_project_builds = Build.objects.filter(project = default_project)
|
||||||
|
|
||||||
if (not toastermain.settings.BUILD_MODE) and default_project_builds.count() > 0:
|
|
||||||
args = (default_project.id,)
|
|
||||||
return redirect(reverse('projectbuilds', args = args), permanent = False)
|
|
||||||
|
|
||||||
# we only redirect to projects page if there is a user-generated project
|
# we only redirect to projects page if there is a user-generated project
|
||||||
num_builds = Build.objects.all().count()
|
num_builds = Build.objects.all().count()
|
||||||
user_projects = Project.objects.filter(is_default = False)
|
user_projects = Project.objects.filter(is_default = False)
|
||||||
|
@ -102,9 +98,6 @@ def _get_latest_builds(prj=None):
|
||||||
if prj is not None:
|
if prj is not None:
|
||||||
queryset = queryset.filter(project = prj)
|
queryset = queryset.filter(project = prj)
|
||||||
|
|
||||||
if not toastermain.settings.BUILD_MODE:
|
|
||||||
queryset = queryset.exclude(project__is_default=False)
|
|
||||||
|
|
||||||
return list(itertools.chain(
|
return list(itertools.chain(
|
||||||
queryset.filter(outcome=Build.IN_PROGRESS).order_by("-started_on"),
|
queryset.filter(outcome=Build.IN_PROGRESS).order_by("-started_on"),
|
||||||
queryset.filter(outcome__lt=Build.IN_PROGRESS).order_by("-started_on")[:3] ))
|
queryset.filter(outcome__lt=Build.IN_PROGRESS).order_by("-started_on")[:3] ))
|
||||||
|
@ -1893,10 +1886,6 @@ def managedcontextprocessor(request):
|
||||||
"projects": projects,
|
"projects": projects,
|
||||||
"non_cli_projects": projects.exclude(is_default=True),
|
"non_cli_projects": projects.exclude(is_default=True),
|
||||||
"DEBUG" : toastermain.settings.DEBUG,
|
"DEBUG" : toastermain.settings.DEBUG,
|
||||||
|
|
||||||
# True if Toaster is in build mode, False otherwise
|
|
||||||
"BUILD_MODE": toastermain.settings.BUILD_MODE,
|
|
||||||
|
|
||||||
"CUSTOM_IMAGE" : toastermain.settings.CUSTOM_IMAGE,
|
"CUSTOM_IMAGE" : toastermain.settings.CUSTOM_IMAGE,
|
||||||
"TOASTER_BRANCH": toastermain.settings.TOASTER_BRANCH,
|
"TOASTER_BRANCH": toastermain.settings.TOASTER_BRANCH,
|
||||||
"TOASTER_REVISION" : toastermain.settings.TOASTER_REVISION,
|
"TOASTER_REVISION" : toastermain.settings.TOASTER_REVISION,
|
||||||
|
@ -1939,11 +1928,6 @@ if True:
|
||||||
|
|
||||||
queryset = Build.objects.all()
|
queryset = Build.objects.all()
|
||||||
|
|
||||||
# if in analysis mode, exclude builds for all projects except
|
|
||||||
# command line builds
|
|
||||||
if not toastermain.settings.BUILD_MODE:
|
|
||||||
queryset = queryset.exclude(project__is_default=False)
|
|
||||||
|
|
||||||
redirect_page = resolve(request.path_info).url_name
|
redirect_page = resolve(request.path_info).url_name
|
||||||
|
|
||||||
context, pagesize, orderby = _build_list_helper(request,
|
context, pagesize, orderby = _build_list_helper(request,
|
||||||
|
@ -3048,10 +3032,6 @@ if True:
|
||||||
queryset_all = queryset_all.filter(Q(is_default=False) |
|
queryset_all = queryset_all.filter(Q(is_default=False) |
|
||||||
q_default_with_builds)
|
q_default_with_builds)
|
||||||
|
|
||||||
# if in BUILD_MODE, exclude everything but the command line builds project
|
|
||||||
if not toastermain.settings.BUILD_MODE:
|
|
||||||
queryset_all = queryset_all.exclude(is_default=False)
|
|
||||||
|
|
||||||
# boilerplate code that takes a request for an object type and returns a queryset
|
# boilerplate code that takes a request for an object type and returns a queryset
|
||||||
# for that object type. copypasta for all needed table searches
|
# for that object type. copypasta for all needed table searches
|
||||||
(filter_string, search_term, ordering_string) = _search_tuple(request, Project)
|
(filter_string, search_term, ordering_string) = _search_tuple(request, Project)
|
||||||
|
|
|
@ -92,9 +92,6 @@ if 'DATABASE_URL' in os.environ:
|
||||||
else:
|
else:
|
||||||
raise Exception("FIXME: Please implement missing database url schema for url: %s" % dburl)
|
raise Exception("FIXME: Please implement missing database url schema for url: %s" % dburl)
|
||||||
|
|
||||||
BUILD_MODE = False
|
|
||||||
if 'TOASTER_MANAGED' in os.environ and os.environ['TOASTER_MANAGED'] == "1":
|
|
||||||
BUILD_MODE = True
|
|
||||||
|
|
||||||
# Allows current database settings to be exported as a DATABASE_URL environment variable value
|
# Allows current database settings to be exported as a DATABASE_URL environment variable value
|
||||||
|
|
||||||
|
|
|
@ -59,12 +59,11 @@ if toastermain.settings.DEBUG_PANEL_ENABLED:
|
||||||
urlpatterns.insert(1, url(r'', include(debug_toolbar.urls)))
|
urlpatterns.insert(1, url(r'', include(debug_toolbar.urls)))
|
||||||
#logger.info("Enabled django_toolbar extension")
|
#logger.info("Enabled django_toolbar extension")
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
# Uncomment the next line to enable the admin:
|
||||||
|
url(r'^admin/', include(admin.site.urls)),
|
||||||
|
] + urlpatterns
|
||||||
|
|
||||||
if toastermain.settings.BUILD_MODE:
|
|
||||||
urlpatterns = [
|
|
||||||
# Uncomment the next line to enable the admin:
|
|
||||||
url(r'^admin/', include(admin.site.urls)),
|
|
||||||
] + urlpatterns
|
|
||||||
# Automatically discover urls.py in various apps, beside our own
|
# Automatically discover urls.py in various apps, beside our own
|
||||||
# and map module directories to the patterns
|
# and map module directories to the patterns
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue