From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 71004E00AF2; Tue, 24 Nov 2015 06:29:41 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high * trust * [192.55.52.115 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 147FFE00AE4 for ; Tue, 24 Nov 2015 06:29:38 -0800 (PST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 24 Nov 2015 06:29:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,338,1444719600"; d="scan'208";a="693412169" Received: from linux.intel.com ([10.23.219.25]) by orsmga003.jf.intel.com with ESMTP; 24 Nov 2015 06:29:16 -0800 Received: from linux.intel.com (vmed.fi.intel.com [10.237.72.51]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTP id F31746A4005; Tue, 24 Nov 2015 06:28:07 -0800 (PST) Date: Tue, 24 Nov 2015 15:58:00 +0200 From: Ed Bartosh To: Scott Rifenbark Message-ID: <20151124135800.GA2987@linux.intel.com> References: MIME-Version: 1.0 In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "toaster@yoctoproject.org" Subject: Re: [PATCH 18/27] toaster: remove usage of BUILD_MODE variable X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: ed.bartosh@linux.intel.com List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2015 14:29:41 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Scott, You can remove these 2 lines from the documentation: Enable Build Mode by adding the following line to settings.py: BUILD_MODE=True However, a lot more changes will be needed if this patchset is accepted. I'm going to prepare separate patch for the documentation after it's merged. On Tue, Nov 24, 2015 at 04:33:30AM -0800, Scott Rifenbark wrote: > The BUILD_MODE variable appears in Step 3 of the "Installation" section in > the Toaster Manual ( > http://www.yoctoproject.org/docs/2.0/toaster-manual/toaster-manual.html#toaster-installation-steps). > Can you advise me on any manual change here that might affect 2.0.1 and 2.1? > > Thanks, > Scott > > On Tue, Nov 24, 2015 at 3:33 AM, Ed Bartosh > wrote: > > > 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. > > > > Signed-off-by: Ed Bartosh > > --- > > bitbake/lib/toaster/toastergui/templates/base.html | 9 +-------- > > .../lib/toaster/toastergui/templates/landing.html | 10 ---------- > > bitbake/lib/toaster/toastergui/tests.py | 4 ---- > > bitbake/lib/toaster/toastergui/views.py | 20 > > -------------------- > > bitbake/lib/toaster/toastermain/settings.py | 3 --- > > bitbake/lib/toaster/toastermain/urls.py | 9 ++++----- > > 6 files changed, 5 insertions(+), 50 deletions(-) > > > > diff --git a/bitbake/lib/toaster/toastergui/templates/base.html > > b/bitbake/lib/toaster/toastergui/templates/base.html > > index e0b15ce..8081f06 100644 > > --- a/bitbake/lib/toaster/toastergui/templates/base.html > > +++ b/bitbake/lib/toaster/toastergui/templates/base.html > > @@ -79,7 +79,7 @@ > > > data-content="
Branch
{{TOASTER_BRANCH}}
Revision
{{TOASTER_REVISION}}
">
> > {% endif %} > > > > - {% 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' %} > > > > > > - > > - > > - {% if BUILD_MODE %} > > -
> > - New project > > -
> > - {% endif %} > > > > > > > > diff --git a/bitbake/lib/toaster/toastergui/templates/landing.html > > b/bitbake/lib/toaster/toastergui/templates/landing.html > > index cafaa1a..a1b5cdc 100644 > > --- a/bitbake/lib/toaster/toastergui/templates/landing.html > > +++ b/bitbake/lib/toaster/toastergui/templates/landing.html > > @@ -6,9 +6,6 @@ > > > > {% block title %} Welcome to Toaster {% endblock %} > > {% block pagecontent %} > > - > > - {% if BUILD_MODE %} > > - > >
> >
> >
> > @@ -62,11 +59,4 @@ > >
> >
> >
> > - {% else %} > > - > > -
> > - Toaster has not recorded any builds yet. Run a build from the > > command line to see it here. > > -
> > - {% endif %} > > - > > {% endblock %} > > diff --git a/bitbake/lib/toaster/toastergui/tests.py > > b/bitbake/lib/toaster/toastergui/tests.py > > index 9e6c46a..3685fd8 100644 > > --- a/bitbake/lib/toaster/toastergui/tests.py > > +++ b/bitbake/lib/toaster/toastergui/tests.py > > @@ -42,10 +42,6 @@ import re > > PROJECT_NAME = "test project" > > 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): > > """Tests to verify view APIs.""" > > > > diff --git a/bitbake/lib/toaster/toastergui/views.py > > b/bitbake/lib/toaster/toastergui/views.py > > index 0e255f1..69f5af0 100755 > > --- a/bitbake/lib/toaster/toastergui/views.py > > +++ b/bitbake/lib/toaster/toastergui/views.py > > @@ -76,10 +76,6 @@ def landing(request): > > default_project = Project.objects.get_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 > > num_builds = Build.objects.all().count() > > user_projects = Project.objects.filter(is_default = False) > > @@ -102,9 +98,6 @@ def _get_latest_builds(prj=None): > > if prj is not None: > > queryset = queryset.filter(project = prj) > > > > - if not toastermain.settings.BUILD_MODE: > > - queryset = queryset.exclude(project__is_default=False) > > - > > return list(itertools.chain( > > > > queryset.filter(outcome=Build.IN_PROGRESS).order_by("-started_on"), > > > > queryset.filter(outcome__lt=Build.IN_PROGRESS).order_by("-started_on")[:3] > > )) > > @@ -1893,10 +1886,6 @@ def managedcontextprocessor(request): > > "projects": projects, > > "non_cli_projects": projects.exclude(is_default=True), > > "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, > > "TOASTER_BRANCH": toastermain.settings.TOASTER_BRANCH, > > "TOASTER_REVISION" : toastermain.settings.TOASTER_REVISION, > > @@ -1939,11 +1928,6 @@ if True: > > > > 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 > > > > context, pagesize, orderby = _build_list_helper(request, > > @@ -3048,10 +3032,6 @@ if True: > > queryset_all = queryset_all.filter(Q(is_default=False) | > > 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 > > # for that object type. copypasta for all needed table searches > > (filter_string, search_term, ordering_string) = > > _search_tuple(request, Project) > > diff --git a/bitbake/lib/toaster/toastermain/settings.py > > b/bitbake/lib/toaster/toastermain/settings.py > > index b28ddb2..de686b2 100644 > > --- a/bitbake/lib/toaster/toastermain/settings.py > > +++ b/bitbake/lib/toaster/toastermain/settings.py > > @@ -92,9 +92,6 @@ if 'DATABASE_URL' in os.environ: > > else: > > 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 > > > > diff --git a/bitbake/lib/toaster/toastermain/urls.py > > b/bitbake/lib/toaster/toastermain/urls.py > > index 6c4a953..5ce5a92 100644 > > --- a/bitbake/lib/toaster/toastermain/urls.py > > +++ b/bitbake/lib/toaster/toastermain/urls.py > > @@ -59,12 +59,11 @@ if toastermain.settings.DEBUG_PANEL_ENABLED: > > urlpatterns.insert(1, url(r'', include(debug_toolbar.urls))) > > #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 > > # and map module directories to the patterns > > > > -- > > 2.1.4 > > > > -- > > _______________________________________________ > > toaster mailing list > > toaster@yoctoproject.org > > https://lists.yoctoproject.org/listinfo/toaster > > -- -- Regards, Ed