Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 27 Aug 2014, 11:07
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
gtkDialog3 script tester. Works, needs further development.
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [1 Post]  
Author Message
sunburnt


Joined: 08 Jun 2005
Posts: 5016
Location: Arizona, U.S.A.

PostPosted: Thu 18 Mar 2010, 01:32    Post subject:  gtkDialog3 script tester. Works, needs further development.  

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:
#!/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`
   " &
gtkdialog.tester.gz
Description  I put in: /root/my-applications/bin
gz

 Download 
Filename  gtkdialog.tester.gz 
Filesize  640 Bytes 
Downloaded  241 Time(s) 
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [1 Post]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0427s ][ Queries: 13 (0.0041s) ][ GZIP on ]