update delete system

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@657 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2012-01-13 21:23:03 +00:00
parent 6e2a0f3e2b
commit ce2dfa8338
17 changed files with 47 additions and 25 deletions

View File

@ -1,9 +1,9 @@
Package: webif
Priority: optional
Section: web
Version: 0.8.11-1
Version: 0.8.12
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: mongoose(>=3.0-2),jim(>=0.71-1),jim-sqlite3(>=0.71-1),jim-cgi(>=0.5),jim-oo,jim-pack,service-control,busybox(>=1.19.3-1),lsof,epg(>=1.0.8),hmt(>=1.1.4),ssmtp,anacron
Depends: mongoose(>=3.0-2),jim(>=0.71-1),jim-sqlite3(>=0.71-1),jim-cgi(>=0.5),jim-oo,jim-pack,service-control,busybox(>=1.19.3-1),lsof,epg(>=1.0.8),hmt(>=1.1.4),ssmtp,anacron,trm
Suggests: ffmpeg,webif-iphone,nicesplice,id3v2
Description: An evolving web interface for the Humax.

View File

@ -2,7 +2,7 @@
package require cgi
source /mod/var/mongoose/lib/setup
require ts.class system.class
require ts.class system.class tdelete
puts "Content-Type: text/html"
puts ""
@ -46,14 +46,14 @@ if {$type eq "ts"} {
while {[file isdirectory $ndir]} { append ndir "_" }
file rename $file $ndir
} else {
puts [exec /mod/bin/busybox/rm -rf $file]
tdelete $file
}
puts -nonewline "Done..."
} else {
if {$dustbin ne ""} {
file rename $file "[bindir $file]/[file tail $file]"
} else {
file delete $file
tdelete $file
}
catch {file delete "[file rootname $file].hmi"}

View File

@ -2,7 +2,7 @@
package require cgi
source /mod/var/mongoose/lib/setup
require ts.class pretty_size system.class
require ts.class pretty_size system.class tdelete
puts "Content-Type: text/html\r\n\r\n"
@ -44,7 +44,7 @@ foreach file [cgi_get files] {
while {[file isdirectory $ndir]} { append ndir "_" }
file rename $file $ndir
} else {
puts [exec /mod/bin/busybox/rm -rf $file]
tdelete $file
}
puts -nonewline "Done..."
} elseif {[string match {*.ts} $file]} {
@ -62,7 +62,7 @@ foreach file [cgi_get files] {
if {$dustbin ne ""} {
file rename $file "[bindir $file]/[file tail $file]"
} else {
file delete $file
tdelete $file
}
catch {file delete "[file rootname $file].hmi"}
puts -nonewline "Done..."

View File

@ -59,7 +59,7 @@ foreach tw [$db query {
order by usLcn
} $tsIdx]
set mux "???"
set mux "Local"
set ehs 0
foreach chan $channels {
lassign $chan x lcn x name
@ -72,6 +72,7 @@ foreach tw [$db query {
"ITV3" { set mux "COM4/SDN" }
"Dave" { set mux "COM5/ARQ A" }
"Film4" { set mux "COM6/ARQ B" }
"Movies4Men" { set mux "Local" }
}
}
puts "<td>$mux</td>"

View File

@ -1,5 +1,5 @@
if {[expr ! [exists -proc altrow ]]} {
if {![exists -proc altrow]} {
proc altrow {} {{i 0}} {
if { $i == 0 } {
puts "<tr class=odd>"

View File

@ -1,5 +1,5 @@
if {[expr ! [exists -proc cat ]]} {
if {![exists -proc cat]} {
proc cat {file} {
if {[catch {set fp [open $file r}]} { return }
puts [read $fp]

View File

@ -1,5 +1,5 @@
if {[expr ! [exists -proc classdump]]} {
if {![exists -proc classdump]} {
proc classdump {o} {
foreach var [$o vars] {
puts [format {%20s %s} $var [$o get $var]]

View File

@ -1,5 +1,5 @@
if {![exists -proc class ]} { package require oo }
if {![exists -proc class]} { package require oo }
class clipboard {
path "/tmp/webif.cb"

View File

@ -1,7 +1,7 @@
source /mod/var/mongoose/lib/setup
if {![exists -proc class ]} { package require oo }
if {![exists -proc sqlite3.open ]} { package require sqlite3 }
if {![exists -proc class]} { package require oo }
if {![exists -proc sqlite3.open]} { package require sqlite3 }
require settings.class progressbar rsv.class

View File

@ -1,5 +1,5 @@
if {[expr ! [exists -proc escape]]} {
if {![exists -proc escape]} {
proc escape {str} {
regsub -all -- {"} "$str" "\\\"" str
return $str

View File

@ -1,5 +1,5 @@
if {[expr ! [exists -proc class ]]} { package require oo }
if {![exists -proc class]} { package require oo }
class pkg {
name ""

View File

@ -1,5 +1,5 @@
if {[expr ! [exists -proc pretty_size ]]} {
if {![exists -proc pretty_size]} {
proc pretty_size {size} {
set units {bytes KiB MiB GiB TiB}

View File

@ -1,5 +1,5 @@
if {[expr ! [exists -proc progressbar ]]} {
if {![exists -proc progressbar]} {
proc progressbar {percent} {
set pos [expr 118 - $percent / 100.0 * 118]
return "<img src=/img/percentimage.png

View File

@ -1,6 +1,6 @@
if {![exists -proc class ]} { package require oo }
if {![exists -proc sqlite3.open ]} { package require sqlite3 }
if {![exists -proc class]} { package require oo }
if {![exists -proc sqlite3.open]} { package require sqlite3 }
if {![file exists /mod/etc/webif.db]} {
set settingsdb [sqlite3.open /mod/etc/webif.db]

View File

@ -1,6 +1,6 @@
if {![exists -proc class ]} { package require oo }
if {![exists -proc sqlite3.open ]} { package require sqlite3 }
if {![exists -proc class]} { package require oo }
if {![exists -proc sqlite3.open]} { package require sqlite3 }
class system {}

19
var/mongoose/lib/tdelete Normal file
View File

@ -0,0 +1,19 @@
if {![exists -proc tdelete]} {
proc tdelete {path} {
if {[file isdirectory $path]} {
regsub -all {([\\["$])} $path {\\\1} path
foreach file [glob -nocomplain "${path}/*"] {
if {[file isdirectory $file]} {
system tdelete $file
} else {
exec /mod/bin/trm $file
}
}
exec /mod/bin/busybox/rm -rf $path
} else {
exec /mod/bin/trm $path
}
}
}

View File

@ -1,5 +1,7 @@
if {![exists -proc class ]} { package require oo }
if {![exists -proc class]} { package require oo }
source /mod/var/mongoose/lib/setup
require tdelete
set dmsfile /mnt/hd2/dms_cds.db
@ -124,8 +126,8 @@ ts method delete {} {
# for torrent names.
regsub -all {([\\["$])} $root {\\\1} root
foreach f [glob -nocomplain "${root}.*"] {
tdelete $f
puts "Removed $f<br>"
file delete $f
}
return 1
}