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 Thu 30 Oct 2014, 11:38
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 Posts_count_1  
Author Message
sunburnt


Joined: 08 Jun 2005
Posts: 5039
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  250 Time(s) 
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count_1  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


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