cookutils diff web/cookiso.cgi @ rev 728
Move to using short i18n functions with "printf", so rewrite sources and po files. Fix: stripping before list files (python packages listed missed .pyc files). Also remove few hacks from code, make pot and msgmerge.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Thu May 07 15:11:47 2015 +0300 (2015-05-07) |
parents | ab08b97140dc |
children | 1d1f65203fa3 |
line diff
1.1 --- a/web/cookiso.cgi Sat Mar 17 23:02:31 2012 +0100 1.2 +++ b/web/cookiso.cgi Thu May 07 15:11:47 2015 +0300 1.3 @@ -2,13 +2,15 @@ 1.4 # 1.5 # SliTaz Cookiso CGI/web interface. 1.6 # 1.7 -echo "Content-Type: text/html" 1.8 -echo "" 1.9 +echo 'Content-Type: text/html' 1.10 +echo '' 1.11 1.12 [ -f "/etc/slitaz/cook.conf" ] && . /etc/slitaz/cook.conf 1.13 [ -f "cook.conf" ] && . ./cook.conf 1.14 1.15 + 1.16 # Cookiso DB files. 1.17 + 1.18 cache="$CACHE/cookiso" 1.19 iso="$SLITAZ/iso" 1.20 activity="$cache/activity" 1.21 @@ -16,6 +18,7 @@ 1.22 rollog="$cache/rolling.log" 1.23 synclog="$cache/rsync.log" 1.24 1.25 + 1.26 # 1.27 # Functions 1.28 # 1.29 @@ -33,29 +36,32 @@ 1.30 esac 1.31 } 1.32 1.33 + 1.34 # Latest build pkgs. 1.35 + 1.36 list_isos() { 1.37 cd $iso 1.38 ls -1t *.iso | head -6 | \ 1.39 - while read file 1.40 - do 1.41 + while read file; do 1.42 echo -n $(stat -c '%y' $file | cut -d . -f 1 | sed s/:[0-9]*$//) 1.43 echo " : $file" 1.44 done 1.45 } 1.46 1.47 + 1.48 # xHTML header. Pages can be customized with a separate html.header file. 1.49 -if [ -f "header.html" ]; then 1.50 + 1.51 +if [ -f 'header.html' ]; then 1.52 cat header.html | sed s'/Cooker/ISO Cooker/' 1.53 else 1.54 - cat << EOT 1.55 + cat <<EOT 1.56 <!DOCTYPE html> 1.57 -<html xmlns="http://www.w3.org/1999/xhtml"> 1.58 +<html lang="en"> 1.59 <head> 1.60 + <meta charset="utf-8"/> 1.61 <title>SliTaz ISO Cooker</title> 1.62 - <meta charset="utf-8" /> 1.63 - <link rel="shortcut icon" href="favicon.ico" /> 1.64 - <link rel="stylesheet" type="text/css" href="style.css" /> 1.65 + <link rel="shortcut icon" href="favicon.ico"/> 1.66 + <link rel="stylesheet" type="text/css" href="style.css"/> 1.67 </head> 1.68 <body> 1.69 1.70 @@ -93,15 +99,16 @@ 1.71 echo '<pre>' 1.72 cat $log | syntax_highlighter log 1.73 echo '</pre>' ;; 1.74 + 1.75 *) 1.76 # Main page with summary. 1.77 - echo -n "Running command : " 1.78 + echo -n 'Running command : ' 1.79 if [ -f "$command" ]; then 1.80 cat $command 1.81 else 1.82 - echo "Not running" 1.83 + echo 'Not running' 1.84 fi 1.85 - cat << EOT 1.86 + cat <<EOT 1.87 <h2>Activity</h2> 1.88 <pre> 1.89 $(tac $activity | head -n 12 | syntax_highlighter activity) 1.90 @@ -114,14 +121,14 @@ 1.91 EOT 1.92 # Rolling Bot log. 1.93 if [ -f "$rollog" ]; then 1.94 - echo "<h2>Rolling log</h2>" 1.95 + echo '<h2>Rolling log</h2>' 1.96 echo '<pre>' 1.97 cat $rollog 1.98 echo '</pre>' 1.99 fi 1.100 # Rsync log. 1.101 if [ -f "$synclog" ]; then 1.102 - echo "<h2>Rsync log</h2>" 1.103 + echo '<h2>Rsync log</h2>' 1.104 echo '<pre>' 1.105 awk '{ 1.106 if (/\/s/) h=$0; 1.107 @@ -135,8 +142,10 @@ 1.108 fi ;; 1.109 esac 1.110 1.111 + 1.112 # Close xHTML page 1.113 -cat << EOT 1.114 + 1.115 +cat <<EOT 1.116 </div> 1.117 1.118 <div id="footer">