Skip to contentSkip to conversation

Toaster patchset

PATCH New Alex DAMIAN 1 participant 12 messages May 11, 2015

lore
Share & tools
lore
#0 lore raw

cover Toaster patchset

From: Alexandru DAMIAN <[email protected]>

Hello,

This a bug fixing patchset that cleans up the code and fixes some legacy issues, partially refactors the URL structure for a cleaner appliance of REST principles, and enables the code to passes tests under TTS.

Can you please pull at your convenience ?

Thank you,
Alex

The following changes since commit 3e12f4e8e3ec66d1df772a64be04b90ec72462ae:

prserv: serv.py: remove unused and duplicate imports (2015-05-08 17:46:25 +0100)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib adamian/20150511-submission-bb
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=adamian/20150511-submission-bb

Alexander Kanevskiy (1):
toaster: clear up toaster shutdown for mac osx

Alexandru DAMIAN (4):
toasterui: URL refactoring
toaster: adding art missing from Bootstrap
toastergui: fix whitespace after URL
toastergui: removing unused views

Ed Bartosh (5):
toastergui: decrease load time for configuration page
toaster: Make toaster script working in zsh
toaster: Code cleanup: indent
toaster: fix typo in format string
toastergui: Consider task name when restarting a build

Mihail Stanciu (1):
toaster: <Add class id to a few columns>

 bin/toaster                                        | 149 +++++++++---------
 lib/toaster/orm/models.py                          |   2 +-
 .../static/img/glyphicons-halflings-white.png      | Bin 0 -> 8777 bytes
 .../toastergui/static/img/glyphicons-halflings.png | Bin 0 -> 12799 bytes
 lib/toaster/toastergui/static/js/projectapp.js     |   2 +-
 .../toastergui/templates/basetable_top_layers.html |   2 +-
 lib/toaster/toastergui/templates/bpackage.html     |   4 +-
 lib/toaster/toastergui/templates/importlayer.html  |   2 +-
 lib/toaster/toastergui/templates/layer.html        |  34 -----
 lib/toaster/toastergui/templates/layerdetails.html |   8 +-
 lib/toaster/toastergui/templates/layers.html       |  14 +-
 lib/toaster/toastergui/templates/machines.html     |   4 +-
 lib/toaster/toastergui/templates/package.html      |  36 -----
 lib/toaster/toastergui/templates/project.html      |  24 +--
 lib/toaster/toastergui/templates/recipes.html      |   8 +-
 lib/toaster/toastergui/templates/targets.html      |   6 +-
 lib/toaster/toastergui/templates/tasks.html        |   8 +-
 lib/toaster/toastergui/urls.py                     |  26 ++--
 lib/toaster/toastergui/views.py                    | 169 ++++++---------------
 19 files changed, 177 insertions(+), 321 deletions(-)
 create mode 100644 lib/toaster/toastergui/static/img/glyphicons-halflings-white.png
 create mode 100644 lib/toaster/toastergui/static/img/glyphicons-halflings.png
 delete mode 100644 lib/toaster/toastergui/templates/layer.html
 delete mode 100644 lib/toaster/toastergui/templates/package.html
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/11 toaster: clear up toaster shutdown for mac osx

From: Alexander Kanevskiy <[email protected]>

This patch properly shuts down toaster in interactive mode under Mac OSx.

---
 bin/toaster | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bin/toaster +1 -1
index 7907b57..792fb72 100755
@@ -37,7 +37,7 @@ function webserverKillAll()
 			kill -SIGTERM -$(< ${pidfile}) 2>/dev/null
 			sleep 1;
 			# Kill processes if they are still running - may happen in interactive shells
-			ps fux | grep "python.*manage.py runserver" | awk '{print $2}' | xargs kill
+			pkill -U $UID -f "python.*manage.py runserver"
 		done;
 		rm  ${pidfile}
 		fi
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/11 toastergui: decrease load time for configuration page

From: Ed Bartosh <[email protected]>

Used __in field lookup for QuerySet to get build variables faster.

[YOCTO #6691]

---
 lib/toaster/toastergui/views.py | 46 ++++++++---------------------------------
 1 file changed, 9 insertions(+), 37 deletions(-)
lib/toaster/toastergui/views.py +9 -37
index 7e90926..e296cf6 100755
@@ -1266,43 +1266,15 @@ def recipes(request, build_id):
 def configuration(request, build_id):
     template = 'configuration.html'
 
-    variables = Variable.objects.filter(build=build_id)
-
-    def _get_variable_or_empty(variable_name):
-        from django.core.exceptions import ObjectDoesNotExist
-        try:
-            return variables.get(variable_name=variable_name).variable_value
-        except ObjectDoesNotExist:
-            return ''
-
-    BB_VERSION=_get_variable_or_empty(variable_name='BB_VERSION')
-    BUILD_SYS=_get_variable_or_empty(variable_name='BUILD_SYS')
-    NATIVELSBSTRING=_get_variable_or_empty(variable_name='NATIVELSBSTRING')
-    TARGET_SYS=_get_variable_or_empty(variable_name='TARGET_SYS')
-    MACHINE=_get_variable_or_empty(variable_name='MACHINE')
-    DISTRO=_get_variable_or_empty(variable_name='DISTRO')
-    DISTRO_VERSION=_get_variable_or_empty(variable_name='DISTRO_VERSION')
-    TUNE_FEATURES=_get_variable_or_empty(variable_name='TUNE_FEATURES')
-    TARGET_FPU=_get_variable_or_empty(variable_name='TARGET_FPU')
-
-    targets = Target.objects.filter(build=build_id)
-
-    context = {
-                'objectname': 'configuration',
-                'object_search_display':'variables',
-                'filter_search_display':'variables',
-                'build': Build.objects.get(pk=build_id),
-                'BB_VERSION':BB_VERSION,
-                'BUILD_SYS':BUILD_SYS,
-                'NATIVELSBSTRING':NATIVELSBSTRING,
-                'TARGET_SYS':TARGET_SYS,
-                'MACHINE':MACHINE,
-                'DISTRO':DISTRO,
-                'DISTRO_VERSION':DISTRO_VERSION,
-                'TUNE_FEATURES':TUNE_FEATURES,
-                'TARGET_FPU':TARGET_FPU,
-                'targets':targets,
-        }
+    var_names = ('BB_VERSION', 'BUILD_SYS', 'NATIVELSBSTRING', 'TARGET_SYS',
+                 'MACHINE', 'DISTRO', 'DISTRO_VERSION', 'TUNE_FEATURES', 'TARGET_FPU')
+    context = dict(Variable.objects.filter(build=build_id, variable_name__in=var_names)\
+                                           .values_list('variable_name', 'variable_value'))
+    context.update({'objectname': 'configuration',
+                    'object_search_display':'variables',
+                    'filter_search_display':'variables',
+                    'build': Build.objects.get(pk=build_id),
+                    'targets': Target.objects.filter(build=build_id)})
     return render(request, template, context)
 
 
Signature · 1 line
1.9.1
#3 lore raw

PATCH 3/11 toaster: Make toaster script working in zsh

In reply to Alex DAMIAN

From: Ed Bartosh <[email protected]>

Fixed shell syntax not understood by zsh. Made toaster script to work for both shells in both modes: sourced and directly called.

[YOCTO #6964]

---
 bin/toaster | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
bin/toaster +13 -13
index 792fb72..8568c13 100755
@@ -63,7 +63,7 @@ function webserverStartAll()
             retval=0
             python $BBBASEDIR/lib/toaster/manage.py migrate orm || retval=1
         fi
-	if [ "x$TOASTER_MANAGED" == "x1" ]; then
+	if [ "$TOASTER_MANAGED" '==' '1' ]; then
 	        python $BBBASEDIR/lib/toaster/manage.py migrate bldcontrol || retval=1
 		python $BBBASEDIR/lib/toaster/manage.py checksettings  --traceback || retval=1
 	fi
@@ -97,7 +97,7 @@ INSTOPSYSTEM=0
 function stop_system()
 {
     # prevent reentry
-    if [ $INSTOPSYSTEM == 1 ]; then return; fi
+    if [ $INSTOPSYSTEM -eq 1 ]; then return; fi
     INSTOPSYSTEM=1
     if [ -f ${BUILDDIR}/.toasterui.pid ]; then
         kill $(< ${BUILDDIR}/.toasterui.pid ) 2>/dev/null
@@ -119,7 +119,7 @@ function check_pidbyfile() {
 
 
 function notify_chldexit() {
-    if [ $NOTOASTERUI == 0 ]; then
+    if [ $NOTOASTERUI -eq 0 ]; then
         check_pidbyfile ${BUILDDIR}/.toasterui.pid && return
         stop_system
     fi
@@ -143,8 +143,7 @@ function verify_prereq() {
 
 
 # read command line parameters
-
-BBBASEDIR=`dirname ${BASH_SOURCE}`/..
+BBBASEDIR=`dirname ${BASH_SOURCE:-${(%):-%x}}`/..
 RUNNING=0
 
 NOTOASTERUI=0
@@ -168,8 +167,9 @@ for param in $*; do
     esac
 done
 
+[ -z "$ZSH_NAME" ] && SRCFILE=${BASH_SOURCE} || SRCFILE=$_
 
-if [ -z "$ZSH_NAME" ] && [ `basename \"$0\"` = `basename \"$BASH_SOURCE\"` ]; then
+if [ `basename \"$0\"` = `basename \"${SRCFILE}\"` ]; then
     # We are called as standalone. We refuse to run in a build environment - we need the interactive mode for that.
     # Start just the web server, point the web browser to the interface, and start any Django services.
 
@@ -183,7 +183,7 @@ if [ -z "$ZSH_NAME" ] && [ `basename \"$0\"` = `basename \"$BASH_SOURCE\"` ]; th
         exit 1;
     fi
 
-    if [ "x`which daemon`" == "x" ]; then
+    if ! which daemon >/dev/null 2>&1; then
         echo -e "Failed dependency; toaster needs the 'daemon' program in order to be able to start builds'. Please install the 'daemon' program from your distribution repositories or http://www.libslack.org/daemon/" 1>&2;
 	exit 1;
     fi
@@ -251,14 +251,14 @@ fi
 
 
 # We make sure we're running in the current shell and in a good environment
-if [ -z "$BUILDDIR" ] || [ -z `which bitbake` ]; then
+if [ -z "$BUILDDIR" ] ||  ! which bitbake >/dev/null 2>&1 ; then
     echo "Error: Build environment is not setup or bitbake is not in path." 1>&2;
     return 2
 fi
 
 
 # Determine the action. If specified by arguments, fine, if not, toggle it
-if [ "x$1" == "xstart" ] || [ "x$1" == "xstop" ]; then
+if [ "$1" '==' 'start' ] || [ "$1" '==' 'stop' ]; then
     CMD="$1"
 else
     if [ -z "$BBSERVER" ]; then
@@ -274,16 +274,16 @@ echo "The system will $CMD."
 
 lock=1
 if [ -e $BUILDDIR/bitbake.lock ]; then
-    (flock -n 200 ) 200<$BUILDDIR/bitbake.lock || lock=0
+    python -c "import fcntl; fcntl.flock(open(\"$BUILDDIR/bitbake.lock\"), fcntl.LOCK_EX|fcntl.LOCK_NB)" 2>/dev/null || lock=0
 fi
 
-if [ ${CMD} == "start" ] && [ $lock -eq 0 ]; then
+if [ ${CMD} '==' 'start' ] && [ $lock -eq 0 ]; then
     echo "Error: bitbake lock state error. File locks show that the system is on." 1>&2
     echo "Please wait for the current build to finish, stop and then start the system again." 1>&2
     return 3
 fi
 
-if [ ${CMD} == "start" ] && [ -e $BUILDDIR/.toastermain.pid ] && kill -0 `cat $BUILDDIR/.toastermain.pid`; then
+if [ ${CMD} '==' 'start' ] && [ -e $BUILDDIR/.toastermain.pid ] && kill -0 `cat $BUILDDIR/.toastermain.pid`; then
     echo "Warning: bitbake appears to be dead, but the Toaster web server is running. Something fishy is going on." 1>&2
     echo "Cleaning up the web server to start from a clean slate."
     webserverKillAll
@@ -311,7 +311,7 @@ case $CMD in
             echo "Bitbake server start failed"
         else
             export BBSERVER=0.0.0.0:-1
-            if [ $NOTOASTERUI == 0 ]; then        # we start the TOASTERUI only if not inhibited
+            if [ $NOTOASTERUI -eq 0 ]; then        # we start the TOASTERUI only if not inhibited
                 bitbake --observe-only -u toasterui >>${BUILDDIR}/toaster_ui.log 2>&1 & echo $! >${BUILDDIR}/.toasterui.pid
             fi
         fi
Signature · 1 line
1.9.1
#4 lore raw

PATCH 4/11 toaster: Code cleanup: indent

In reply to Alex DAMIAN

From: Ed Bartosh <[email protected]>

Replaced tabs with 4 spaces.
Removed useless semicolons at the end of lines.

---
 bin/toaster | 125 ++++++++++++++++++++++++++++++------------------------------
 1 file changed, 62 insertions(+), 63 deletions(-)
bin/toaster +62 -63
index 8568c13..f5ee68c 100755
@@ -30,65 +30,65 @@
 
 function webserverKillAll()
 {
-	local pidfile
-	for pidfile in ${BUILDDIR}/.toastermain.pid; do
-		if [ -f ${pidfile} ]; then
-		while kill -0 $(< ${pidfile}) 2>/dev/null; do
-			kill -SIGTERM -$(< ${pidfile}) 2>/dev/null
-			sleep 1;
-			# Kill processes if they are still running - may happen in interactive shells
-			pkill -U $UID -f "python.*manage.py runserver"
-		done;
-		rm  ${pidfile}
-		fi
-	done
+    local pidfile
+    for pidfile in ${BUILDDIR}/.toastermain.pid; do
+        if [ -f ${pidfile} ]; then
+        while kill -0 $(< ${pidfile}) 2>/dev/null; do
+            kill -SIGTERM -$(< ${pidfile}) 2>/dev/null
+            sleep 1
+            # Kill processes if they are still running - may happen in interactive shells
+            pkill -U $UID -f "python.*manage.py runserver"
+        done;
+        rm  ${pidfile}
+        fi
+    done
 }
 
 function webserverStartAll()
 {
-	# do not start if toastermain points to a valid process
-	if ! cat "${BUILDDIR}/.toastermain.pid" 2>/dev/null | xargs -I{} kill -0 {} ; then
-            retval=1
-            rm "${BUILDDIR}/.toastermain.pid"
-        fi
+    # do not start if toastermain points to a valid process
+    if ! cat "${BUILDDIR}/.toastermain.pid" 2>/dev/null | xargs -I{} kill -0 {} ; then
+        retval=1
+        rm "${BUILDDIR}/.toastermain.pid"
+    fi
 
+    retval=0
+    python $BBBASEDIR/lib/toaster/manage.py syncdb || retval=1
+    python $BBBASEDIR/lib/toaster/manage.py migrate orm || retval=2
+    if [ $retval -eq 1 ]; then
+        echo "Failed db sync, stopping system start" 1>&2
+    elif [ $retval -eq 2 ]; then
+        echo -e "\nError on migration, trying to recover... \n"
+        python $BBBASEDIR/lib/toaster/manage.py migrate orm 0001_initial --fake
         retval=0
-        python $BBBASEDIR/lib/toaster/manage.py syncdb || retval=1
-        python $BBBASEDIR/lib/toaster/manage.py migrate orm || retval=2
-        if [ $retval -eq 1 ]; then
-                echo "Failed db sync, stopping system start" 1>&2
-        elif [ $retval -eq 2 ]; then
-            echo -e "\nError on migration, trying to recover... \n"
-            python $BBBASEDIR/lib/toaster/manage.py migrate orm 0001_initial --fake
-            retval=0
-            python $BBBASEDIR/lib/toaster/manage.py migrate orm || retval=1
-        fi
-	if [ "$TOASTER_MANAGED" '==' '1' ]; then
-	        python $BBBASEDIR/lib/toaster/manage.py migrate bldcontrol || retval=1
-		python $BBBASEDIR/lib/toaster/manage.py checksettings  --traceback || retval=1
-	fi
-        if [ $retval -eq 0 ]; then
-	    echo "Starting webserver..."
-            python $BBBASEDIR/lib/toaster/manage.py runserver "0.0.0.0:$WEB_PORT" </dev/null >>${BUILDDIR}/toaster_web.log 2>&1 & echo $! >${BUILDDIR}/.toastermain.pid
-            sleep 1
-            if ! cat "${BUILDDIR}/.toastermain.pid" | xargs -I{} kill -0 {} ; then
-                retval=1
-                rm "${BUILDDIR}/.toastermain.pid"
-	    else
-		echo "Webserver address:  http://0.0.0.0:$WEB_PORT/"
-            fi
+        python $BBBASEDIR/lib/toaster/manage.py migrate orm || retval=1
+    fi
+    if [ "$TOASTER_MANAGED" '==' '1' ]; then
+        python $BBBASEDIR/lib/toaster/manage.py migrate bldcontrol || retval=1
+        python $BBBASEDIR/lib/toaster/manage.py checksettings  --traceback || retval=1
+    fi
+    if [ $retval -eq 0 ]; then
+        echo "Starting webserver..."
+        python $BBBASEDIR/lib/toaster/manage.py runserver "0.0.0.0:$WEB_PORT" </dev/null >>${BUILDDIR}/toaster_web.log 2>&1 & echo $! >${BUILDDIR}/.toastermain.pid
+        sleep 1
+        if ! cat "${BUILDDIR}/.toastermain.pid" | xargs -I{} kill -0 {} ; then
+            retval=1
+            rm "${BUILDDIR}/.toastermain.pid"
+        else
+            echo "Webserver address:  http://0.0.0.0:$WEB_PORT/"
         fi
-        return $retval
+    fi
+    return $retval
 }
 
 # Helper functions to add a special configuration file
 
 function addtoConfiguration()
 {
-        file=$1
-        shift
-        echo "#Created by toaster start script" > ${BUILDDIR}/conf/$file
-        for var in "$@"; do echo $var >> ${BUILDDIR}/conf/$file; done
+    file=$1
+    shift
+    echo "#Created by toaster start script" > ${BUILDDIR}/conf/$file
+    for var in "$@"; do echo $var >> ${BUILDDIR}/conf/$file; done
 }
 
 INSTOPSYSTEM=0
@@ -127,7 +127,7 @@ function notify_chldexit() {
 
 
 function verify_prereq() {
-	# Verify prerequisites
+    # Verify prerequisites
 
     if ! echo "import django; print (1,) == django.VERSION[0:1] and django.VERSION[1:2][0] in (6,)" | python 2>/dev/null | grep True >/dev/null; then
         echo -e "This program needs Django 1.6. Please install with\n\npip install django==1.6\n"
@@ -174,25 +174,25 @@ if [ `basename \"$0\"` = `basename \"${SRCFILE}\"` ]; then
     # Start just the web server, point the web browser to the interface, and start any Django services.
 
     if ! verify_prereq; then
-        echo -e "Error: Could not verify that the needed dependencies are installed. Please use virtualenv and pip to install dependencies listed in toaster-requirements.txt" 1>&2;
-        exit 1;
+        echo -e "Error: Could not verify that the needed dependencies are installed. Please use virtualenv and pip to install dependencies listed in toaster-requirements.txt" 1>&2
+        exit 1
     fi
 
     if [ -n "$BUILDDIR" ]; then
-	echo -e "Error: It looks like you sourced oe-init-build-env. Toaster cannot start in build mode from an oe-core build environment.\n You should be starting Toaster from a new terminal window." 1>&2;
-        exit 1;
+        echo -e "Error: It looks like you sourced oe-init-build-env. Toaster cannot start in build mode from an oe-core build environment.\n You should be starting Toaster from a new terminal window." 1>&2
+        exit 1
     fi
 
     if ! which daemon >/dev/null 2>&1; then
-        echo -e "Failed dependency; toaster needs the 'daemon' program in order to be able to start builds'. Please install the 'daemon' program from your distribution repositories or http://www.libslack.org/daemon/" 1>&2;
-	exit 1;
+        echo -e "Failed dependency; toaster needs the 'daemon' program in order to be able to start builds'. Please install the 'daemon' program from your distribution repositories or http://www.libslack.org/daemon/" 1>&2
+        exit 1
     fi
 
     # Define a fake builddir where only the pid files are actually created. No real builds will take place here.
     BUILDDIR=/tmp/toaster_$$
     if [ -d "$BUILDDIR" ]; then
         echo -e "Previous toaster run directory $BUILDDIR found, cowardly refusing to start. Please remove the directory when that toaster instance is over" 2>&1
-        exit 1;
+        exit 1
     fi
 
     mkdir -p "$BUILDDIR"
@@ -219,14 +219,14 @@ if [ `basename \"$0\"` = `basename \"${SRCFILE}\"` ]; then
         else
             echo "No errors found, removing the run directory '$BUILDDIR'"
             do_cleanup
-        fi;
+        fi
     }
     TOASTER_MANAGED=1
     export TOASTER_MANAGED=1
     if [ $WEBSERVER -gt 0 ] && ! webserverStartAll; then
-        echo "Failed to start the web server, stopping" 1>&2;
+        echo "Failed to start the web server, stopping" 1>&2
         cleanup
-        exit 1;
+        exit 1
     fi
     if [ $WEBSERVER -gt 0 ]; then
         echo "Starting browser..."
@@ -245,14 +245,14 @@ fi
 
 
 if ! verify_prereq; then
-	echo -e "Error: Could not verify that the needed dependencies are installed. Please use virtualenv and pip to install dependencies listed in toaster-requirements.txt" 1>&2;
-	return 1;
+    echo -e "Error: Could not verify that the needed dependencies are installed. Please use virtualenv and pip to install dependencies listed in toaster-requirements.txt" 1>&2
+    return 1
 fi
 
 
 # We make sure we're running in the current shell and in a good environment
 if [ -z "$BUILDDIR" ] ||  ! which bitbake >/dev/null 2>&1 ; then
-    echo "Error: Build environment is not setup or bitbake is not in path." 1>&2;
+    echo "Error: Build environment is not setup or bitbake is not in path." 1>&2
     return 2
 fi
 
@@ -265,7 +265,7 @@ else
         CMD="start"
     else
         CMD="stop"
-    fi;
+    fi
 fi
 
 echo "The system will $CMD."
@@ -303,7 +303,7 @@ case $CMD in
         unset BBSERVER
         PREREAD=""
         if [ -e ${BUILDDIR}/conf/toaster-pre.conf ]; then
-		rm ${BUILDDIR}/conf/toaster-pre.conf
+            rm ${BUILDDIR}/conf/toaster-pre.conf
         fi
         bitbake $PREREAD --postread conf/toaster.conf --server-only -t xmlrpc -B 0.0.0.0:0
         if [ $? -ne 0 ]; then
@@ -337,4 +337,3 @@ case $CMD in
     ;;
 esac
 
-
Signature · 1 line
1.9.1
#5 lore raw

PATCH 5/11 toaster: fix typo in format string

In reply to Alex DAMIAN

From: Ed Bartosh <[email protected]>

Fixed TypeError: not all arguments converted during string formatting

[YOCTO #7618]

---
 lib/toaster/orm/models.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/toaster/orm/models.py +1 -1
index b9bb896..c00c352 100644
@@ -52,7 +52,7 @@ class ToasterSetting(models.Model):
     value = models.CharField(max_length=255)
 
     def __unicode__(self):
-        return "Setting %s = " % (self.name, self.value)
+        return "Setting %s = %s" % (self.name, self.value)
 
 class ProjectManager(models.Manager):
     def create_project(self, name, release):
Signature · 1 line
1.9.1
#6 lore raw

PATCH 6/11 toaster: <Add class id to a few columns>

In reply to Alex DAMIAN

From: Mihail Stanciu <[email protected]>

Added class ids to columns that were missing them in the Packages and Recipes pages. This is required for Toaster UI automation efforts.

[YOCTO #7377]

---
 lib/toaster/toastergui/templates/bpackage.html | 4 ++--
 lib/toaster/toastergui/templates/recipes.html  | 8 ++++++--
 2 files changed, 8 insertions(+), 4 deletions(-)
lib/toaster/toastergui/templates/bpackage.html +2 -2
index 80229f9..6fbdc7b 100644
@@ -60,9 +60,9 @@
     <tr class="data">
 
         <!-- Package -->
-        <td><a href="{% url "package_built_detail" build.pk package.pk %}">{{package.name}}</a></td>
+        <td class="package_name"><a href="{% url "package_built_detail" build.pk package.pk %}">{{package.name}}</a></td>
         <!-- Package Version -->
-        <td>{%if package.version%}<a href="{% url "package_built_detail" build.pk package.pk %}">{{package.version}}-{{package.revision}}</a>{%endif%}</td>
+        <td class="package_version">{%if package.version%}<a href="{% url "package_built_detail" build.pk package.pk %}">{{package.version}}-{{package.revision}}</a>{%endif%}</td>
         <!-- Package Size -->
         <td class="size sizecol">{{package.size|filtered_filesizeformat}}</td>
         <!-- License -->
lib/toaster/toastergui/templates/recipes.html +6 -2
index 458d724..dc2d9e8 100644
@@ -41,8 +41,12 @@
     {% for recipe in objects %}
 
     <tr class="data">
-        <td><a href="{% url "recipe" build.pk recipe.pk %}">{{recipe.name}}</a></td>
-        <td><a href="{% url "recipe" build.pk recipe.pk %}">{{recipe.version}}</a></td>
+        <td class="recipe__name">
+            <a href="{% url "recipe" build.pk recipe.pk %}">{{recipe.name}}</a>
+        </td>
+        <td class="recipe__version">
+            <a href="{% url "recipe" build.pk recipe.pk %}">{{recipe.version}}</a>
+        </td>
         <!-- Depends -->
         <td class="depends_on">
             {% with deps=recipe_deps|get_dict_value:recipe.pk %}
Signature · 1 line
1.9.1
#7 lore raw

PATCH 7/11 toastergui: Consider task name when restarting a build

In reply to Alex DAMIAN

From: Ed Bartosh <[email protected]>

'Run again' button now restarts the build using target:task if task was specified for the build.

[YOCTO #7442]

---
 lib/toaster/toastergui/static/js/projectapp.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/toaster/toastergui/static/js/projectapp.js +1 -1
index 43436c5..a3309c7 100644
@@ -357,7 +357,7 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc
     };
 
     $scope.buildExistingTarget = function(targets) {
-         $scope.buildTargetList(targets.map(function(v){return v.target;}));
+         $scope.buildTargetList(targets.map(function(v){return ((v.task) ? v.target + ":" + v.task : v.target);}));
     };
 
     $scope.buildTargetList = function(targetlist) {
Signature · 1 line
1.9.1
#8 lore raw

PATCH 8/11 toasterui: URL refactoring

In reply to Alex DAMIAN

From: Alexandru DAMIAN <[email protected]>

This is a URL refactoring needed to remove the inadvertent usage of server-side user session in a REST-style API. We move the parameters that were stored in the user session to the URL, making navigation more robust.

This refactoring allows a clean (no 500 HTTP return codes) crawl of the website following inside links.

---
 .../toastergui/templates/basetable_top_layers.html |  2 +-
 lib/toaster/toastergui/templates/importlayer.html  |  2 +-
 lib/toaster/toastergui/templates/layerdetails.html |  8 +-
 lib/toaster/toastergui/templates/layers.html       | 14 ++--
 lib/toaster/toastergui/templates/machines.html     |  4 +-
 lib/toaster/toastergui/templates/project.html      | 24 +++---
 lib/toaster/toastergui/templates/targets.html      |  6 +-
 lib/toaster/toastergui/urls.py                     | 21 +++--
 lib/toaster/toastergui/views.py                    | 94 +++++++++-------------
 9 files changed, 80 insertions(+), 95 deletions(-)
lib/toaster/toastergui/templates/basetable_top_layers.html +1 -1
index bd6e7dd..722091b 100644
@@ -1,5 +1,5 @@
 {% extends "basetable_top.html" %}
 
 {%block custombuttons %}
-    <a class="btn" href="{% url 'importlayer' %}" style="margin-right:5px;">Import layer</a>
+    <a class="btn" href="{% url 'importlayer' project.id %}" style="margin-right:5px;">Import layer</a>
 {%endblock%}
lib/toaster/toastergui/templates/importlayer.html +1 -1
index ed03b2e..d73c319 100644
@@ -14,7 +14,7 @@
                   <script>
                     $(document).ready(function (){
                       var ctx = {
-                        layerDetailsUrl : "{% url 'base_layerdetails' %}",
+                        layerDetailsUrl : "{% url 'base_layerdetails' project.id %}",
                         xhrImportLayerUrl : "{% url 'xhr_importlayer' %}",
                       };
 
lib/toaster/toastergui/templates/layerdetails.html +4 -4
index 4b27d05..4d892d5 100644
@@ -3,7 +3,7 @@
 {% load humanize %}
 {% load static %}
 {% block localbreadcrumb %}
-<li><a href="{% url 'layers' %}">All compatible layers</a></li>
+<li><a href="{% url 'all-layers' project.id %}">All compatible layers</a></li>
 <li>
   {{layerversion.layer.name}} ({{layerversion.get_vcs_reference|truncatechars:13}})
 </li>
@@ -17,7 +17,7 @@
   $(document).ready(function (){
     var ctx = {
       projectBuildUrl : "{% url 'xhr_build' %}",
-      layerDetailsUrl : "{% url 'base_layerdetails' %}",
+      layerDetailsUrl : "{% url 'base_layerdetails' project.id %}",
       xhrUpdateLayerUrl : "{% url 'xhr_updatelayer' %}",
       numTargets : {{total_targets}},
       numMachines: {{machines|length}},
@@ -26,7 +26,7 @@
         id : {{layerversion.id}},
         commit: "{{layerversion.get_vcs_reference}}",
         inCurrentPrj : {{layer_in_project}},
-        url : "{% url 'layerdetails' layerversion.id  %}",
+        url : "{% url 'layerdetails' project.id layerversion.id  %}",
         sourceId: {{layerversion.layer_source_id}},
       }
     };
@@ -164,7 +164,7 @@
                       {% for ld in layerversion.dependencies.all %}
                       <span class="current-value">
                       <li data-layer-id="{{ld.depends_on.id}}">
-                        <a data-toggle="tooltip" title="{{ld.depends_on.layer.vcs_url}} | {{ld.depends_on.get_vcs_reference}}" href="{% url 'layerdetails' ld.depends_on.id %}">{{ld.depends_on.layer.name}}</a>
+                        <a data-toggle="tooltip" title="{{ld.depends_on.layer.vcs_url}} | {{ld.depends_on.get_vcs_reference}}" href="{% url 'layerdetails' project.id ld.depends_on.id %}">{{ld.depends_on.layer.name}}</a>
                         <span class="icon-trash " data-toggle="tooltip" title="Delete"></span>
                       </li>
                       </span>
lib/toaster/toastergui/templates/layers.html +7 -7
index 2367e7c..abad007 100644
@@ -73,14 +73,14 @@
 {% include "basetable_top_layers.html" %}
     {% for o in objects %}
     <tr class="data">
-            <td class="layer"><a href="{% url 'layerdetails' o.id %}">{{o.layer.name}}</a></td>
+            <td class="layer"><a href="{% url 'layerdetails' project.id o.id %}">{{o.layer.name}}</a></td>
             <td class="description">{% if o.layer.summary %}{{o.layer.summary}}{%endif%}</td>
-            <td class="git-repo"><a href="{% url 'layerdetails' o.pk %}"><code>{{o.layer.vcs_url}}</code></a>
+            <td class="git-repo"><a href="{% url 'layerdetails' project.id o.pk %}"><code>{{o.layer.vcs_url}}</code></a>
             {% if o.get_vcs_link_url %}
             <a target="_blank" href="{{ o.get_vcs_link_url }}"><i class="icon-share get-info"></i></a>
         {% endif %}
         </td>
-            <td class="git-subdir" style="display: table-cell;"><a href="{% url 'layerdetails' o.pk %}"><code>{{o.dirpath}}</code></a>
+            <td class="git-subdir" style="display: table-cell;"><a href="{% url 'layerdetails' project.id o.pk %}"><code>{{o.dirpath}}</code></a>
                 {% if o.dirpath and o.get_vcs_dirpath_link_url %}
             <a target="_blank" href="{{ o.get_vcs_dirpath_link_url }}"><i class="icon-share get-info"></i></a>
                 {% endif %}
@@ -100,10 +100,10 @@
         {% with ods=o.dependencies.all%}
             {% if ods.count %}
                     <a class="btn"
-                        title="<a href='{% url "layerdetails" o.pk %}'>{{o.layer.name}}</a> dependencies"
+                        title="<a href='{% url "layerdetails" project.id o.pk %}'>{{o.layer.name}}</a> dependencies"
                         data-content="<ul class='unstyled'>
                           {% for i in ods%}
-                            <li><a href='{% url "layerdetails" i.depends_on.pk %}'>{{i.depends_on.layer.name}}</a></li>
+                            <li><a href='{% url "layerdetails" project.id i.depends_on.pk %}'>{{i.depends_on.layer.name}}</a></li>
                           {% endfor %}
                         </ul>">
                         {{ods.count}}
@@ -113,11 +113,11 @@
             </td>
             {% if project %}
             <td class="add-del-layers" value="{{o.pk}}">
-                <button class="btn btn-danger btn-block layer-exists-{{o.pk}} layerbtn" style="display:none;" data-layer='{ "id": {{o.pk}}, "name":  "{{o.layer.name}}", "url": "{%url 'layerdetails' o.pk%}"}' data-directive="remove" >
+                <button class="btn btn-danger btn-block layer-exists-{{o.pk}} layerbtn" style="display:none;" data-layer='{ "id": {{o.pk}}, "name":  "{{o.layer.name}}", "url": "{%url 'layerdetails' project.id o.pk%}"}' data-directive="remove" >
                     <i class="icon-trash"></i>
                     Delete layer
                 </button>
-                <button class="btn btn-block layer-add-{{o.pk}} layerbtn" data-layer='{ "id": {{o.pk}}, "name":  "{{o.layer.name}}", "url": "{%url 'layerdetails' o.pk%}"}' data-directive="add">
+                <button class="btn btn-block layer-add-{{o.pk}} layerbtn" data-layer='{ "id": {{o.pk}}, "name":  "{{o.layer.name}}", "url": "{%url 'layerdetails' project.id o.pk%}"}' data-directive="add">
                     <i class="icon-plus"></i>
                     Add layer
                 </button>
lib/toaster/toastergui/templates/machines.html +2 -2
index d116a45..4a09862 100644
@@ -69,12 +69,12 @@
   <tr class="data">
     <td class="machine">{{o.name}}</td>
     <td class="description">{{o.description}}</td>
-    <td class="layer"><a href="{%url "layerdetails" o.layer_version.id %}">{{o.layer_version.layer.name}}</a></td>
+    <td class="layer"><a href="{%url "layerdetails" project.id o.layer_version.id %}">{{o.layer_version.layer.name}}</a></td>
     <td class="branch">{{o.layer_version.get_vcs_reference}}</td>
     <td class="machinefile"><code>/machine/conf/{{o.name}}.conf</code><a href="{{o.get_vcs_machine_file_link_url}}" target="_blank"><i class="icon-share get-info"></i></a></td>
     <td class="select-or-add" style="height: 32px;">
       <a href="{% url 'project' project.id %}#/machineselect={{o.name}}" class="btn btn-block layer-exists-{{o.layer_version.id}}" style="margin-top: 5px; display:none">Select machine</a>
-      <button class="btn btn-block layerbtn layer-add-{{o.layer_version.id}}" data-layer='{ "id": {{o.layer_version.id}}, "name":  "{{o.layer_version.layer.name}}", "url": "{%url 'layerdetails' o.layer_version.id %}"}' data-directive="add">
+      <button class="btn btn-block layerbtn layer-add-{{o.layer_version.id}}" data-layer='{ "id": {{o.layer_version.id}}, "name":  "{{o.layer_version.layer.name}}", "url": "{%url 'layerdetails' project.id o.layer_version.id %}"}' data-directive="add">
         <i class="icon-plus"></i>
         Add layer
         <i title="" class="icon-question-sign get-help" data-original-title="To enable this machine, you must first add the {{o.layer_version.layer.name}} layer to your project"></i></i>
lib/toaster/toastergui/templates/project.html +12 -12
index 5f8f4d1..85a1b16 100644
@@ -24,7 +24,7 @@ vim: expandtab tabstop=2
 	  <p>Toaster has no layer information. Without layer information, you cannot run builds. To generate layer information you can:</p>
 		<ul>
 			 <li> <a href="http://www.yoctoproject.org/docs/latest/toaster-manual/toaster-manual.html#layer-source">Configure a layer source</a></li>
-			 <li> <a href="{% url 'importlayer' %}">Import a layer</a></li>
+			 <li> <a href="{% url 'importlayer' project.id %}">Import a layer</a></li>
 		</ul>
 </div>
 
@@ -111,7 +111,7 @@ vim: expandtab tabstop=2
       </div>
       <i class="icon-question-sign get-help get-help-blue" title="Type the name of one or more recipes you want to build, separated by a space. You can also specify a task by appending a semicolon and a task name to a recipe name, like so: <code>core-image-minimal:do_build</code>"></i>
       <p>
-        <a href="{% url 'all-targets' %}">View all compatible recipes</a>
+        <a href="{% url 'all-targets' project.id %}">View all compatible recipes</a>
         <i class="icon-question-sign get-help get-help-blue heading-help" title="View all the recipes you can build with the release selected for this project, which is {[project.release.desc]}"></i>
         {% if completedbuilds.count %}
           | <a href="{% url 'projectbuilds' project.id %}">View all project builds ({{completedbuilds.count}})</a>
@@ -278,8 +278,8 @@ vim: expandtab tabstop=2
         <p>
         You can:
           <ul>
-            <li> <a href="{% url 'layers'%}">View all compatible layers available in Toaster</a>
-            <li> <a href="{% url 'importlayer' %}">Import a layer</a>
+            <li> <a href="{% url 'all-layers' project.id %}">View all compatible layers available in Toaster</a>
+            <li> <a href="{% url 'importlayer' project.id %}">Import a layer</a>
             <li> <a href="https://www.yoctoproject.org/docs/1.6.1/dev-manual/dev-manual.html#understanding-and-creating-layers" target="_blank">Read about layers in the manual</a>
           </ul>
         Or type a layer name below.
@@ -293,10 +293,10 @@ vim: expandtab tabstop=2
         {% csrf_token %}
       </form>
       <p>
-        <a href="{% url 'layers' %}">View all compatible layers</a>
+        <a href="{% url 'all-layers' project.id %}">View all compatible layers</a>
         <i class="icon-question-sign get-help" title="View all the layers you can build with the release selected for this project, which is {[project.release.desc]}"></i>
         |
-        <a href="{% url 'importlayer' %}">Import layer</a></p>
+        <a href="{% url 'importlayer' project.id %}">Import layer</a></p>
       <ul class="unstyled configuration-list">
           <li ng-repeat="l in layers track by l.id" class="animate-repeat">
             <a href="{[l.layerdetailurl]}" class="layer-info" data-toggle="tooltip" tooltip-placement="right" tooltip="{[l.giturl]} | {[l.branch.name]}">{[l.name]}</a>
@@ -321,7 +321,7 @@ vim: expandtab tabstop=2
           {% csrf_token %}
         </form>
         <p>
-          <a href="{% url 'all-targets' %}">View all compatible recipes</a>
+          <a href="{% url 'all-targets' project.id %}">View all compatible recipes</a>
           <i class="icon-question-sign get-help" title="View all the recipes you can build with the release selected for this project, which is {[project.release.desc]}"></i>
         </p>
         <div ng-if="frequenttargets.length">
@@ -361,7 +361,7 @@ vim: expandtab tabstop=2
               {% csrf_token %}
         </form>
         <p>
-          <a href="{% url 'machines' %}" class="link">View all compatible machines</a>
+          <a href="{% url 'all-machines' project.id %}" class="link">View all compatible machines</a>
         <i class="icon-question-sign get-help" title="View all the machines you can set with the release selected for this project, which is {[project.release.desc]}"></i>
       </p>
       </div>
@@ -432,10 +432,10 @@ angular.element(document).ready(function() {
   scope.urls.xhr_build = "{% url 'xhr_projectbuild' project.id %}";
   scope.urls.xhr_edit = "{% url 'xhr_projectedit' project.id %}";
   scope.urls.xhr_datatypeahead = "{% url 'xhr_datatypeahead' %}";
-  scope.urls.layers = "{% url 'layers' %}";
-  scope.urls.targets = "{% url 'all-targets' %}";
-  scope.urls.importlayer = "{% url 'importlayer'%}";
-  scope.urls.layer = "{% url 'base_layerdetails' %}";
+  scope.urls.layers = "{% url 'all-layers' project.id %}";
+  scope.urls.targets = "{% url 'all-targets' project.id %}";
+  scope.urls.importlayer = "{% url 'importlayer' project.id %}";
+  scope.urls.layer = "{% url 'base_layerdetails' project.id %}";
   scope.project = {{prj|json}};
   scope.builds = {{builds|json}};
   scope.layers = {{layers|json}};
lib/toaster/toastergui/templates/targets.html +3 -3
index 903e841..dc2cef6 100644
@@ -62,7 +62,7 @@
       <p>Toaster has no recipe information. To generate recipe information you can:</p>
       <ul>
        <li><a href="http://www.yoctoproject.org/docs/latest/toaster-manual/toaster-manual.html#layer-source">Configure a layer source</a></li>
-       <li><a href="{% url 'importlayer' %}">Import a layer</a>, then run a build</li>
+       <li><a href="{% url 'importlayer' project.id %}">Import a layer</a>, then run a build</li>
       </ul>
     </div>
   {% endif %}
@@ -84,7 +84,7 @@
         </td>
         <td class="target-section">{{o.section}}</td>
         <td class="license">{{o.license}}</td>
-        <td class="layer"><a href="{% url 'layerdetails' o.preffered_layerversion.id%}">{{o.preffered_layerversion.layer.name}}</a></td>
+        <td class="layer"><a href="{% url 'layerdetails' project.id o.preffered_layerversion.id%}">{{o.preffered_layerversion.layer.name}}</a></td>
         <td class="branch">
         {% if o.preffered_layerversion.up_branch %}
             {{o.preffered_layerversion.up_branch.name}}
@@ -101,7 +101,7 @@
           <a href="{% url 'project' project.id %}#/targetbuild={{o.name}}" class="btn btn-block layer-exists-{{o.preffered_layerversion.pk}}" style="display:none; margin-top: 5px;" >
             Build recipe
           </a>
-          <button class="btn btn-block layerbtn layer-add-{{o.preffered_layerversion.pk}}" data-layer='{ "id": {{o.preffered_layerversion.pk}}, "name":  "{{o.preffered_layerversion.layer.name}}", "url": "{%url 'layerdetails' o.preffered_layerversion.pk%}"}' data-directive="add">
+          <button class="btn btn-block layerbtn layer-add-{{o.preffered_layerversion.pk}}" data-layer='{ "id": {{o.preffered_layerversion.pk}}, "name":  "{{o.preffered_layerversion.layer.name}}", "url": "{%url 'layerdetails' project.id o.preffered_layerversion.pk%}"}' data-directive="add">
             <i class="icon-plus"></i>
             Add layer
             <i title="" class="icon-question-sign get-help" data-original-title="To build this target, you must first add the {{o.preffered_layerversion.layer.name}} layer to your project"></i></i>
lib/toaster/toastergui/urls.py +13 -8
index 76357e3..52fc0cc 100644
@@ -76,20 +76,25 @@ urlpatterns = patterns('toastergui.views',
 
         # project URLs
         url(r'^newproject/$', 'newproject', name='newproject'),
-        url(r'^importlayer/$', 'importlayer', name='importlayer'),
 
-        url(r'^layers/$', 'layers', name='layers'),
-        url(r'^layer/(?P<layerid>\d+)/$', 'layerdetails', name='layerdetails'),
-        url(r'^layer/$', lambda x: HttpResponseBadRequest(), name='base_layerdetails'),
-        url(r'^targets/$', 'targets', name='all-targets'),
-        url(r'^machines/$', 'machines', name='machines'),
 
         url(r'^projects/$', 'projects', name='all-projects'),
 
         url(r'^project/$', lambda x: HttpResponseBadRequest(), name='base_project'),
-        url(r'^project/(?P<pid>\d+)/$', 'project', name='project'),
+
+        url(r'^project/(?P<pid>\d+)$', 'project', name='project'),
         url(r'^project/(?P<pid>\d+)/configuration$', 'projectconf', name='projectconf'),
-        url(r'^project/(?P<pid>\d+)/builds$', 'projectbuilds', name='projectbuilds'),
+        url(r'^project/(?P<pid>\d+)/builds/$', 'projectbuilds', name='projectbuilds'),
+
+        url(r'^project/(?P<pid>\d+)/layers/$', 'layers', name='all-layers'),
+        url(r'^project/(?P<pid>\d+)/layer/(?P<layerid>\d+)$', 'layerdetails', name='layerdetails'),
+        url(r'^project/(?P<pid>\d+)/layer/$', lambda x: HttpResponseBadRequest(), name='base_layerdetails'),
+
+        # the import layer is a project-specific functionality;
+        url(r'^project/(?P<pid>\d+)/importlayer$', 'importlayer', name='importlayer'),
+
+        url(r'^project/(?P<pid>\d+)/targets/$', 'targets', name='all-targets'),
+        url(r'^project/(?P<pid>\d+)/machines/$', 'machines', name='all-machines'),
 
         url(r'^xhr_build/$', 'xhr_build', name='xhr_build'),
         url(r'^xhr_projectbuild/(?P<pid>\d+)/$', 'xhr_projectbuild', name='xhr_projectbuild'),
lib/toaster/toastergui/views.py +37 -57

244 lines not on this page · raw message

Signature · 1 line
1.9.1
#9 lore raw

PATCH 9/11 toaster: adding art missing from Bootstrap

In reply to Alex DAMIAN

From: Alexandru DAMIAN <[email protected]>

When Bootstrap 2.3 was imported, we missed a couple of art file.

This patch adds them to complete Bootstrap integrity.

License used is (as previously documented).

GLYPHICONS Halflings released with Bootstrap, CC BY 3.0

---
 .../static/img/glyphicons-halflings-white.png           | Bin 0 -> 8777 bytes
 .../toastergui/static/img/glyphicons-halflings.png      | Bin 0 -> 12799 bytes
 2 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 lib/toaster/toastergui/static/img/glyphicons-halflings-white.png
 create mode 100644 lib/toaster/toastergui/static/img/glyphicons-halflings.png
lib/toaster/toastergui/static/img/glyphicons-halflings-white.png new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..3bf6484a29d8da269f9bc874b25493a45fae3bae
GIT binary patch
lib/toaster/toastergui/static/img/glyphicons-halflings.png new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..a9969993201f9cee63cf9f49217646347297b643
GIT binary patch
Signature · 1 line
1.9.1
#10 lore raw

PATCH 10/11 toastergui: fix whitespace after URL

In reply to Alex DAMIAN

From: Alexandru DAMIAN <[email protected]>

This patch fixes whitespace after URLs in the tasks page, fixing warnings from the linkchecker.

---
 lib/toaster/toastergui/templates/tasks.html | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
lib/toaster/toastergui/templates/tasks.html +4 -4
index 5c1c476..32c0552 100644
@@ -86,13 +86,13 @@
                 <a href="{% url "recipe" build.pk task.recipe.pk %}">{{task.recipe.version}}</a>
             </td>
             <td class="task_name">
-                <a href="{%url "task" build.pk task.pk%} ">{{task.task_name}}</a> {% if task.get_description %}<i class="icon-question-sign get-help hover-help" title="{{task.get_description}}"></i> {% endif %}
+                <a href="{%url "task" build.pk task.pk%}">{{task.task_name}}</a> {% if task.get_description %}<i class="icon-question-sign get-help hover-help" title="{{task.get_description}}"></i> {% endif %}
             </td>
             <td class="executed">
-                <a href="{%url "task" build.pk task.pk%} ">{{task.get_executed_display}}</a>
+                <a href="{%url "task" build.pk task.pk%}">{{task.get_executed_display}}</a>
             </td>
             <td class="outcome">
-                <a href="{%url "task" build.pk task.pk%} ">{{task.get_outcome_display}} </a>
+                <a href="{%url "task" build.pk task.pk%}">{{task.get_outcome_display}} </a>
                 {% if MANAGED and build.project and task.outcome = task.OUTCOME_FAILED %}
                     <a href="{% url 'build_artifact' build.pk "tasklogfile" task.pk %}">
                         <i class="icon-download-alt" title="Download task log file"></i>
@@ -101,7 +101,7 @@
                 <i class="icon-question-sign get-help hover-help" title="{{task.get_outcome_help}}"></i>
             </td>
             <td class="cache_attempt">
-                <a href="{%url "task" build.pk task.pk%} ">{{task.get_sstate_result_display|format_none_and_zero}}</a>
+                <a href="{%url "task" build.pk task.pk%}">{{task.get_sstate_result_display|format_none_and_zero}}</a>
             </td>
             <td class="time_taken">
                 {{task.elapsed_time|format_none_and_zero|floatformat:2}}
Signature · 1 line
1.9.1
#11 lore raw

PATCH 11/11 toastergui: removing unused views

In reply to Alex DAMIAN

From: Alexandru DAMIAN <[email protected]>

We remove url entries, views and templates that are not used in the interface; these are leftovers from the development process, and are not linked anywhere in the interface nor mentioned in documentation.

---
 lib/toaster/toastergui/templates/layer.html   | 34 -------------------------
 lib/toaster/toastergui/templates/package.html | 36 ---------------------------
 lib/toaster/toastergui/urls.py                |  5 ----
 lib/toaster/toastergui/views.py               | 29 ---------------------
 4 files changed, 104 deletions(-)
 delete mode 100644 lib/toaster/toastergui/templates/layer.html
 delete mode 100644 lib/toaster/toastergui/templates/package.html
lib/toaster/toastergui/templates/layer.html deleted +0 -34
deleted file mode 100644
index 410d766..0000000
@@ -1,34 +0,0 @@
-{% extends "basetable.html" %}
-
-{% block pagename %}
-    <h1>Toaster - Layers</h1>
-{% endblock %}
-
-{% block pagetable %}
-    {% load projecttags %}
-
-        <tr>
-            <th>Name</th>
-            <th>Local Path</th>
-            <th>Layer Index URL</th>
-            <th>Known Versions</th>
-        </tr>
-
-        {% for layer in objects %}
-
-        <tr class="data">
-            <td>{{layer.name}}</td>
-            <td>{{layer.local_path}}</td>
-            <td><a href='{{layer.layer_index_url}}'>{{layer.layer_index_url}}</a></td>
-            <td><table>
-            {% for lv in layer.versions %}
-                <tr><td>
-        <a href="{% url "layer_versions_recipes" lv.id %}">({{lv.priority}}){{lv.branch}}:{{lv.commit}} ({{lv.count}} recipes)</a>
-                </td></tr>
-            {% endfor %}
-            </table></td>
-        </tr>
-
-        {% endfor %}
-
-{% endblock %}
lib/toaster/toastergui/templates/package.html deleted +0 -36
deleted file mode 100644
index 1ba3726..0000000
@@ -1,36 +0,0 @@
-{% extends "basebuildpage.html" %}
-
-{% block pagetable %}
-    {% if not objects %}
-        <p>No packages were recorded for this target!</p>
-    {% else %}
-
-            <tr>
-            <th>Name</th>
-            <th>Version</th>
-            <th>Size (Bytes)</th>
-            <th>Recipe</th>
-            <th>Depends on</th>
-            </tr>
-
-            {% for package in objects %}
-
-            <tr class="data">
-                <td><a name="#{{package.name}}">{{package.name}}</a></td>
-                <td>{{package.version}}</td>
-                <td>{{package.size}}</td>
-                <td>{%if package.recipe %}<a name="{{package.recipe.name}}.{{package.package_name}}">
-                <a href="{% url "layer_versions_recipes" package.recipe.layer_version_id %}#{{package.recipe.name}}">{{package.recipe.name}}</a>{{package.package_name}}</a>{%endif%}</td>
-                <td>
-            <div style="height: 4em; overflow:auto">
-                    {% for d in package.package_dependencies_source.all %}
-                    <a href="#{{d.name}}">{{d.depends_on.name}}</a><br/>
-                    {% endfor %}
-            </div>
-                </td>
-
-            {% endfor %}
-
-    {% endif %}
-
-{% endblock %}
lib/toaster/toastergui/urls.py +0 -5
index 52fc0cc..de8c62c 100644
@@ -56,7 +56,6 @@ urlpatterns = patterns('toastergui.views',
         url(r'^dentries/build/(?P<build_id>\d+)/target/(?P<target_id>\d+)$', 'dirinfo_ajax', name='dirinfo_ajax'),
         url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/dirinfo$', 'dirinfo', name='dirinfo'),
         url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/dirinfo_filepath/_(?P<file_path>(?:/[^/\n]+)*)$', 'dirinfo', name='dirinfo_filepath'),
-        url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/packages$', 'tpackage', name='targetpackages'),
         url(r'^build/(?P<build_id>\d+)/configuration$', 'configuration', name='configuration'),
         url(r'^build/(?P<build_id>\d+)/configvars$', 'configvars', name='configvars'),
         url(r'^build/(?P<build_id>\d+)/buildtime$', 'buildtime', name='buildtime'),
@@ -67,13 +66,9 @@ urlpatterns = patterns('toastergui.views',
         url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/packagefile/(?P<packagefile_id>\d+)$',
              'image_information_dir', name='image_information_dir'),
 
-
         # build download artifact
         url(r'^build/(?P<build_id>\d+)/artifact/(?P<artifact_type>\w+)/id/(?P<artifact_id>\w+)', 'build_artifact', name="build_artifact"),
 
-        # urls not linked from the dashboard
-        url(r'^layerversions/(?P<layerversion_id>\d+)/recipes/.*$', 'layer_versions_recipes', name='layer_versions_recipes'),
-
         # project URLs
         url(r'^newproject/$', 'newproject', name='newproject'),
 
lib/toaster/toastergui/views.py +0 -29
index 23025a2..d938fd8 100755
@@ -1479,35 +1479,6 @@ def bfile(request, build_id, package_id):
     context = {'build': Build.objects.get(pk=build_id), 'objects' : files}
     return render(request, template, context)
 
-def tpackage(request, build_id, target_id):
-    template = 'package.html'
-    packages = map(lambda x: x.package, list(Target_Installed_Package.objects.filter(target=target_id)))
-    context = {'build': Build.objects.get(pk=build_id), 'objects' : packages}
-    return render(request, template, context)
-
-def layer(request):
-    template = 'layer.html'
-    layer_info = Layer.objects.all()
-
-    for li in layer_info:
-        li.versions = Layer_Version.objects.filter(layer = li)
-        for liv in li.versions:
-            liv.count = Recipe.objects.filter(layer_version__id = liv.id).count()
-
-    context = {'objects': layer_info}
-
-    return render(request, template, context)
-
-
-def layer_versions_recipes(request, layerversion_id):
-    template = 'recipe.html'
-    recipes = Recipe.objects.filter(layer_version__id = layerversion_id)
-
-    context = {'objects': recipes,
-            'layer_version' : Layer_Version.objects.get( id = layerversion_id )
-    }
-
-    return render(request, template, context)
 
 # A set of dependency types valid for both included and built package views
 OTHER_DEPENDS_BASE = [
Signature · 1 line
1.9.1