gtkDialog3 script tester. Works, needs further development.

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

gtkDialog3 script tester. Works, needs further development.

#1 Post by sunburnt »

I wrote this "gtkdialog.tester" that scans to see if there`s ending Tags for every starting Tag.
I think I got most of the tags, tell me if I missed any. Also it could do more... Suggestions?

Code: Select all

#!/bin/sh
#####		Test gtkDialog file for errors.
N=0
FILE=`Xdialog --stdout --title "  Select gtkDialog file." --fselect /mnt/home/apps/driveman 0 0`
[ $? -gt 0 ]&& exit
rm -f /tmp/gtk-test.results ; GTK=$(<$FILE)

for TAG in vbox hbox pix note list edit text tree menu label input entry radio check table frame combo width height action button window variable progress @
do																															#####		Read the entire file each loop looking for the Tag.
	[ $TAG = '@' ]&& break
	PLUS=`echo "$GTK" |grep -o '<'$TAG | wc -w`																				# count starting tags
	MINUS=`echo "$GTK" |grep -o '</'$TAG | wc -w`																		# count ending tags
	N=$(($PLUS - $MINUS)) ; [ $N -eq 0 ]&& continue															# if count = 0, next loop
	errTAG='' ; [ $N -gt 0 ]&& errTAG='/' ; N=`echo $N |sed 's/^-//'`					# fix ending tag display
	echo "    ###   $errTAG$TAG = $N" >> /tmp/gtk-test.results
done
[ ! -e /tmp/gtk-test.results ]&& echo "    ###   NO Tag problems found.  ###" > /tmp/gtk-test.results		# no errors msg.
xmessage -title "  gtkDialog Test" "
    $FILE    

    ( Tag Type ) = ( Number Missing )    

`cat /tmp/gtk-test.results`
	" &
Attachments
gtkdialog.tester.gz
I put in: /root/my-applications/bin
(640 Bytes) Downloaded 499 times

Post Reply