From f16399ec2fbecf17c1660588305e2847c873a0f6 Mon Sep 17 00:00:00 2001 From: df Date: Mon, 14 Dec 2020 14:06:48 +0000 Subject: [PATCH] exists -proc -> exists -command `exists -command` subsumes `exists -proc` This test is generally checking whether the command exists, rather than some proc that is overriding it. Currently `class` is a proc but this may not always be so. --- webif/lib/browse.class | 2 +- webif/lib/clipboard.class | 2 +- webif/lib/epg.class | 4 ++-- webif/lib/pkg.class | 2 +- webif/lib/queue.class | 4 ++-- webif/lib/rsv.class | 6 +++--- webif/lib/settings.class | 4 ++-- webif/lib/svc.class | 4 ++-- webif/lib/system.class | 6 +++--- webif/lib/ts.class | 6 +++--- webif/lib/tvdb.class | 4 ++-- webif/lib/xml.class | 2 +- 12 files changed, 23 insertions(+), 23 deletions(-) diff --git a/webif/lib/browse.class b/webif/lib/browse.class index 31ae38b..cffe0d2 100644 --- a/webif/lib/browse.class +++ b/webif/lib/browse.class @@ -1,7 +1,7 @@ require system.class plugin -if {![exists -proc class]} { package require oo } +if {![exists -command class]} { package require oo } class dir {} class browse {} diff --git a/webif/lib/clipboard.class b/webif/lib/clipboard.class index 4cf6340..5dc3f51 100644 --- a/webif/lib/clipboard.class +++ b/webif/lib/clipboard.class @@ -1,5 +1,5 @@ -if {![exists -proc class]} { package require oo } +if {![exists -command class]} { package require oo } class clipboard { path "/tmp/webif.cb" diff --git a/webif/lib/epg.class b/webif/lib/epg.class index a32f40e..db05d26 100644 --- a/webif/lib/epg.class +++ b/webif/lib/epg.class @@ -1,7 +1,7 @@ source /mod/webif/lib/setup -if {![exists -proc class]} { package require oo } -if {![exists -proc sqlite3.open]} { package require sqlite3 } +if {![exists -command class]} { package require oo } +if {![exists -command sqlite3.open]} { package require sqlite3 } require settings.class progressbar rsv.class mwildcard svc.class diff --git a/webif/lib/pkg.class b/webif/lib/pkg.class index edd5e98..0cee525 100755 --- a/webif/lib/pkg.class +++ b/webif/lib/pkg.class @@ -1,5 +1,5 @@ -if {![exists -proc class]} { package require oo } +if {![exists -command class]} { package require oo } class pkg { name "" diff --git a/webif/lib/queue.class b/webif/lib/queue.class index 4f8011a..b9811cf 100644 --- a/webif/lib/queue.class +++ b/webif/lib/queue.class @@ -1,6 +1,6 @@ -if {![exists -proc class]} { package require oo } -if {![exists -proc sqlite3.open]} { package require sqlite3 } +if {![exists -command class]} { package require oo } +if {![exists -command sqlite3.open]} { package require sqlite3 } class queue { id -1 diff --git a/webif/lib/rsv.class b/webif/lib/rsv.class index f920c44..b18090b 100644 --- a/webif/lib/rsv.class +++ b/webif/lib/rsv.class @@ -1,8 +1,8 @@ source /mod/webif/lib/setup -if {![exists -proc class]} { package require oo } -if {![exists -proc sqlite3.open]} { package require sqlite3 } -if {![exists -proc binary]} { package require binary } +if {![exists -command class]} { package require oo } +if {![exists -command sqlite3.open]} { package require sqlite3 } +if {![exists -command binary]} { package require binary } require settings.class system.class plugin svc.class set binaryfields aulEventToRecordInfo diff --git a/webif/lib/settings.class b/webif/lib/settings.class index f5edda2..0fd81e6 100644 --- a/webif/lib/settings.class +++ b/webif/lib/settings.class @@ -1,6 +1,6 @@ -if {![exists -proc class]} { package require oo } -if {![exists -proc sqlite3.open]} { package require sqlite3 } +if {![exists -command class]} { package require oo } +if {![exists -command sqlite3.open]} { package require sqlite3 } if {![file exists /mod/etc/webif.db]} { set ::settingsdb [sqlite3.open /mod/etc/webif.db] diff --git a/webif/lib/svc.class b/webif/lib/svc.class index d2d146a..509043b 100755 --- a/webif/lib/svc.class +++ b/webif/lib/svc.class @@ -1,7 +1,7 @@ source /mod/webif/lib/setup -if {![exists -proc class]} { package require oo } -if {![exists -proc sqlite3.open]} { package require sqlite3 } +if {![exists -command class]} { package require oo } +if {![exists -command sqlite3.open]} { package require sqlite3 } require system.class class svc { diff --git a/webif/lib/system.class b/webif/lib/system.class index 8fbc763..f492306 100644 --- a/webif/lib/system.class +++ b/webif/lib/system.class @@ -3,9 +3,9 @@ source /mod/webif/lib/setup package require xconv -if {![exists -proc class]} { package require oo } -if {![exists -proc sqlite3.open]} { package require sqlite3 } -if {![exists -proc binary]} { package require binary } +if {![exists -command class]} { package require oo } +if {![exists -command sqlite3.open]} { package require sqlite3 } +if {![exists -command binary]} { package require binary } class system {} diff --git a/webif/lib/ts.class b/webif/lib/ts.class index b9b6ee2..7aba2c1 100644 --- a/webif/lib/ts.class +++ b/webif/lib/ts.class @@ -1,7 +1,7 @@ -if {![exists -proc class]} { package require oo } -if {![exists -proc pack]} { package require pack } -if {![exists -proc xconv]} { package require xconv } +if {![exists -command class]} { package require oo } +if {![exists -command pack]} { package require pack } +if {![exists -command xconv]} { package require xconv } source /mod/webif/lib/setup require system.class tvdb.class classdump diff --git a/webif/lib/tvdb.class b/webif/lib/tvdb.class index 2abc580..c81cd52 100644 --- a/webif/lib/tvdb.class +++ b/webif/lib/tvdb.class @@ -1,8 +1,8 @@ source /mod/webif/lib/setup package require cgi -if {![exists -proc class]} { package require oo } -if {![exists -proc sqlite3.open]} { package require sqlite3 } +if {![exists -command class]} { package require oo } +if {![exists -command sqlite3.open]} { package require sqlite3 } require system.class xml.class set ::tvdb::apikey 1764335F804A5A91 diff --git a/webif/lib/xml.class b/webif/lib/xml.class index 7cde513..8c3025e 100644 --- a/webif/lib/xml.class +++ b/webif/lib/xml.class @@ -2,7 +2,7 @@ # From https://wiki.tcl-lang.org/page/Parsing+XML # Keith Vetter 2004-03-01 -if {![exists -proc class]} { package require oo } +if {![exists -command class]} { package require oo } class xml { xml ""