Pwget for Dingo (Lobster attempts to program)

Under development: PCMCIA, wireless, etc.
Post Reply
Message
Author
User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

Pwget for Dingo (Lobster attempts to program)

#1 Post by Lobster »

Image
Pwget is a simple front end to the wget utility
for Dingo (Puppy 4).
Well it would be if I could program.

Sadly I have all the programming prowess
of a bag of soggy chips, without the bag

Pwget is used for downloading larger files from the internet such as ISOs using the wget bash command. The files are verified during the download procedure. As ISO and other files are checked, they do not require a md5sum check

basically this is the command

Code: Select all

wget -c -P$DEST $SOURCE

and this is the front end

Code: Select all

#! /bin/bash

# Pwget created by Lobster Jan 2008 for Puppy Dingo and Linux Tmxxine GPL v3 License
# http://tmxxine.com

export Pwget='
<window title="Pwget - File downloader utility">
<vbox>
 <hbox>
  <text><label>Source URL</label></text>
  <entry accept="directory"><variable>SOURCE</variable><input>/tmp/pm_source_dir</input></entry>
  <button>
   <input file icon="gtk-paste"></input>
   <action type="fileselect">SOURCE</action>
   <action>refresh:SOURCE</action>
  </button>
 </hbox>
 <hbox>
  <text><label>Destination Dir</label></text>
  <entry accept="directory"><variable>DEST</variable><input>/tmp/pm_mirror_dir</input></entry>
  <button>
   <input file icon="gtk-open"></input>
   <action type="fileselect">DEST</action>
   <action>refresh:DEST</action>
  </button>
 </hbox>
 <hbox>
  <button help>
   <action>`Xdialog --wrap --screencenter --left --title "Pwget - HELP" --msgbox "Pwget is a simple front end to the wget utility. Wget is used for downloading larger files from the internet such as ISOs. The files are verified during the download procedure. As ISO and other files are checked, they do not require a md5sum check. \n\n Lobster, Jan 2008" 600x0`</action>
  </button>
  <button cancel></button>
  <button ok></button>
 </hbox>
</vbox>
</window>'

gtkdialog3 --program Pwget 
unset Pwget

wget -c -P$DEST $SOURCE
How do I get this working?
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#2 Post by zigbert »

Would this help

Code: Select all

#! /bin/bash

# Pwget created by Lobster Jan 2008 for Puppy Dingo and Linux Tmxxine GPL v3 License
# http://tmxxine.com

export Pwget='
<window title="Pwget - File downloader utility">
<vbox>
 <hbox>
  <text><label>Source URL</label></text>
  <entry accept="directory"><variable>SOURCE</variable><input>/tmp/pm_source_dir</input></entry>
  <button>
   <input file icon="gtk-paste"></input>
   <action type="fileselect">SOURCE</action>
   <action>refresh:SOURCE</action>
  </button>
 </hbox>
 <hbox>
  <text><label>Destination Dir</label></text>
  <entry accept="directory"><variable>DEST</variable><input>/tmp/pm_mirror_dir</input></entry>
  <button>
   <input file icon="gtk-open"></input>
   <action type="fileselect">DEST</action>
   <action>refresh:DEST</action>
  </button>
 </hbox>
 <hbox>
  <button help>
   <action>`Xdialog --wrap --screencenter --left --title "Pwget - HELP" --msgbox "Pwget is a simple front end to the wget utility. Wget is used for downloading larger files from the internet such as ISOs. The files are verified during the download procedure. As ISO and other files are checked, they do not require a md5sum check. \n\n Lobster, Jan 2008" 600x0`</action>
  </button>
  <button cancel></button>
  <button ok></button>
 </hbox>
</vbox>
</window>'

I=$IFS; IFS=""
for STATEMENTS in  $(gtkdialog3 --program=Pwget --center); do
	eval $STATEMENTS
done
IFS=$I
if [ $EXIT = OK ]; then
	wget -c -P"$DEST $SOURCE"
fi
Now it only executes if user press OK-button.

Sigmund

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#3 Post by Lobster »

Many thanks Zigbert

This bit of code (near the bottom works - yours did not
but the rest of it is great :D

Code: Select all

exec wget -c -P $DEST $SOURCE
. . . so it works

I just hacked your pmirror util to get the code incidentally . . . 8)

The only other thing to get working (or remove)
is the paste button? Any thoughts on that?

So the code stands as

Code: Select all

#! /bin/bash

# Pwget GUI front end for Wget created by Lobster and Zigbert Jan 2008 for Puppy Dingo and Linux Tmxxine GPL v3 License
# http://tmxxine.com

export Pwget='
<window title="Pwget - File downloader utility">
<vbox>
 <hbox>
  <text><label>Source URL</label></text>
  <entry accept="directory"><variable>SOURCE</variable><input>/tmp/pm_source_dir</input></entry>
  <button>
   <input file icon="gtk-paste"></input>
   <action type="fileselect">SOURCE</action>
   <action>refresh:SOURCE</action>
  </button>
 </hbox>
 <hbox>
  <text><label>Destination Dir</label></text>
  <entry accept="directory"><variable>DEST</variable><input>/tmp/pm_mirror_dir</input></entry>
  <button>
   <input file icon="gtk-open"></input>
   <action type="fileselect">DEST</action>
   <action>refresh:DEST</action>
  </button>
 </hbox>
 <hbox>
  <button help>
   <action>`Xdialog --wrap --screencenter --left --title "Pwget - HELP" --msgbox "Pwget is a simple front end to the wget utility. Wget is used for downloading larger files from the internet such as ISOs. The files are verified during the download procedure. As ISO and other files are checked, they do not require a md5sum check. Cut and paste the source file you wish to download. Use the file selector to choose the destination. \n\n Lobster, Jan 2008" 600x0`</action>
  </button>
  <button cancel></button>
  <button ok></button>
 </hbox>
</vbox>
</window>'

I=$IFS; IFS=""
for STATEMENTS in  $(gtkdialog3 --program=Pwget --center); do
   eval $STATEMENTS
done
IFS=$I
if [ $EXIT = OK ]; then
  exec wget -c -P $DEST $SOURCE
fi 
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#4 Post by zigbert »

Paste: What should be pasted. You can copy whatever, and paste it into url-field by ctrl+c. Maybe a better question is: What should happen when you press the paste-button.

Code: Select all

exec wget -c -P $DEST $SOURCE
should be

Code: Select all

exec wget -c -P "$DEST" $SOURCE
This to accept paths with spaces in name.

Happy coding :D
Sigmund

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

Make it voice controllable and speaking

#5 Post by mcewanw »

Lobster... you know my feeling on this ...

Little apps like this should be made voice controllable (e.g. cvoicecontrol) and able to speak (e.g espeak) as well as having a good GUI and/or CUI. It is easier to build such facility into an app at the design stage. Your first non-working version is basically just a GUI, but your last version is already getting a bit more complex. I challenge you to make it work better for the visually impaired as well as for those with good vision! :-)

I'm sure you know how I'd do it if I were you, but my challenge is just a challenge: do it anyway you like!

The world of computing for the visually impaired would be a better place if their needs were taken into account at the design stage. It is very difficult to make, say Open Office or Microsoft Office friendly for the visually impaired; such apps have been designed for those who have good eyesight and coordination (icon/mouse-based interfaces with windows and written text).

I do realise that Dingo is unlikely to come with, for example, cvoicecontrol or espeak or similar by default, but these can be added as dotpets.

User avatar
trapster
Posts: 2117
Joined: Mon 28 Nov 2005, 23:14
Location: Maine, USA
Contact:

#6 Post by trapster »

Go Lobster go !!!!!!

FYI
Xwget can be found in puppy under the "internet" menu.
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#7 Post by BarryK »

Lobster,
I'm curious about one thing. Did you try 'gCurl' in Dingo? This is a file downloader that uses libcurl. I've haven't tried it myself, just stuck it in Dingo as didn't have any other downloader.
[url]https://bkhome.org/news/[/url]

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#8 Post by Lobster »

Go Lobster go !!!!!!
:lol:
Did you try 'gCurl' in Dingo?
Ah - I knew you had added an installer but could not remember what . . .
No I have not tried it.
Basically I was in Dingo, needed to download a recent PcLinuxOS to see if the wireless would work on my laptop (it did not incidentally)
Could not find the downloader (written in tcl by Ian) and rather than use the command line (a fate worse than death :roll: ) thought it would be easier to rewrite the util for Dingo.

Also works on Puppy 2.17 using the latest pwget version now. Here is the code if you want to tweak and include in Dingo

Code: Select all

#! /bin/bash

# Pwget created by Lobster with thanks to Zigbert 
# for Puppy Dingo and Linux Tmxxine 
# Jan 2008 GPL v3 License
# http://tmxxine.com

export Pwget='
<window title="Pwget - File downloader utility">
<vbox>
 <hbox>
  <text><label>Cut and Paste URL location of required file into "Address". Add destination and click "OK"</label></text>
 </hbox>
 <hbox>
  <text><label>Address</label></text>
  <entry accept="directory"><variable>SOURCE</variable><input>/tmp/pm_source_dir</input></entry>
 </hbox>
 <hbox>
  <text><label>Destination Dir</label></text>
  <entry accept="directory"><variable>DEST</variable><input>/tmp/pm_mirror_dir</input></entry>
  <button>
   <input file icon="gtk-open"></input>
   <action type="fileselect">DEST</action>
   <action>refresh:DEST</action>
  </button>
 </hbox>
 <hbox>
  <button help>
   <action>`Xdialog --wrap --screencenter --left --title "Pwget - HELP" --msgbox "Pwget is a simple front end to the wget utility. Wget is used for downloading larger files from the internet such as ISOs. The files are verified during the download procedure. As ISO and other files are checked and downloads resumed, they do not require a md5sum check. Cut and paste the source file you wish to download. Use the file selector to choose the destination. \n\n Lobster, Jan 2008" 600x0`</action>
  </button>
  <button cancel></button>
  <text><label>Download</label></text>
  <button ok></button>
 </hbox>
</vbox>
</window>'

I=$IFS; IFS=""
for STATEMENTS in  $(gtkdialog3 --program=Pwget --center); do
   eval $STATEMENTS
done
IFS=$I
if [ $EXIT = OK ]; then
  exec rxvt -name Xwget -bg "#F3F2DF" -e wget -c -P "$DEST" $SOURCE
fi 
Last edited by Lobster on Tue 08 Jan 2008, 07:54, edited 1 time in total.
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
cb88
Posts: 1165
Joined: Mon 29 Jan 2007, 03:12
Location: USA
Contact:

#9 Post by cb88 »

how about adding a mirror function? with several option like to only download if a newer version is avaliable....

i have done that before with wget but i forget the options always just use wget --help :-)

GO Lobster!!!!
Taking Puppy Linux to the limit of perfection. meanwhile try "puppy pfix=duct_tape" kernel parem eater.
X86: Sager NP6110 3630QM 16GB ram, Tyan Thunder 2 2x 300Mhz
Sun: SS2 , LX , SS5 , SS10 , SS20 ,Ultra 1, Ultra 10 , T2000
Mac: Platinum Plus, SE/30

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#10 Post by Lobster »

cb88 wrote:how about adding a mirror function?
m m m . . .
here is me combing my whiskers in front of the mirror . . .
Image

Not what you meant? :oops:

. . . well maybe if someone turns this into a dotpet (and posts on additional software) I will consider that for a future update

(I know it is easy but could not find any info - there is some sort of "dir2pet" command) maybe it is not in 2.17 that I am using . . .
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
cb88
Posts: 1165
Joined: Mon 29 Jan 2007, 03:12
Location: USA
Contact:

#11 Post by cb88 »

what i mean is there is a command line option to mirror a site

say dotpups.de/dotpups/Multimedia/

just that i forget which option it is right now...

it would download all the files at that address and with another option active it would ONLY update the downloaded files if needed

it mirrors a specifyed depth on the site or just one link deep if not specified i think would have to actually use it to be sure an i have linux incompatable modems :-(
Taking Puppy Linux to the limit of perfection. meanwhile try "puppy pfix=duct_tape" kernel parem eater.
X86: Sager NP6110 3630QM 16GB ram, Tyan Thunder 2 2x 300Mhz
Sun: SS2 , LX , SS5 , SS10 , SS20 ,Ultra 1, Ultra 10 , T2000
Mac: Platinum Plus, SE/30

User avatar
Dingo
Posts: 1437
Joined: Tue 11 Dec 2007, 17:48
Location: somewhere at the end of rainbow...
Contact:

#12 Post by Dingo »

works fine for me on Puppy 3.01

User avatar
jcoder24
Posts: 604
Joined: Fri 06 May 2005, 12:33
Location: Barbados

#13 Post by jcoder24 »

cb88 wrote:what i mean is there is a command line option to mirror a site
wget -m or wget --mirror
cb88 wrote:mirrors a specifyed depth on the site or just one link deep if not specified
wget -N -r -l number_of_levels
where number_of_levels is a number 0 or greater. 0 = infinite which is the same as mirror all.

User avatar
cb88
Posts: 1165
Joined: Mon 29 Jan 2007, 03:12
Location: USA
Contact:

#14 Post by cb88 »

thanks jcoder24 that is exactly what i meant
Taking Puppy Linux to the limit of perfection. meanwhile try "puppy pfix=duct_tape" kernel parem eater.
X86: Sager NP6110 3630QM 16GB ram, Tyan Thunder 2 2x 300Mhz
Sun: SS2 , LX , SS5 , SS10 , SS20 ,Ultra 1, Ultra 10 , T2000
Mac: Platinum Plus, SE/30

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#15 Post by MU »

Dotpup:
http://dotpups.de/dotpups/Internet/Pwget.pup
mirror:
http://puppyfiles.ca/dotpupsde/dotpups/ ... /Pwget.pup

I made one change:
after the download, Rox-filer opens with the download-folder.

Lobster:
If you update, just drag /usr/local/bin/Pwget again on the dotpup-wizard.

Mark
Attachments
Pwget.jpg
screenshot
(50.29 KiB) Downloaded 2285 times

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#16 Post by Lobster »

Lobster:
If you update, just drag /usr/local/bin/Pwget again on the dotpup-wizard.


forgot about that program :oops:

Many thanks Mark - much appreciated
I always feel useless when I ask people to help
what I should have remembered . . .

:D
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#17 Post by MU »

no reason to feel useless :)
There meanwhile are so many programs around, that you easily loose overview.
I even cannot remember all those I made myself.
When I find one by accident using the search, I think:
"hmmm? Me was that?" :lol:

Wish you a great weekend :P
Mark

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#18 Post by Lobster »

:) Thanks Mark

Have announced the prog here
http://www.murga-linux.com/puppy/viewto ... 972#167972

I have to chastise my over developed ego
by calling it useless :roll:

Thanks for the weekend wish. You too :D
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

big_bass
Posts: 1740
Joined: Mon 13 Aug 2007, 12:21

#19 Post by big_bass »

Dingo wrote:works fine for me on Puppy 3.01
worked fine for me too version 2.16 fat-free 8)

nice app congrats for such a nice small practical app


big_bass

Post Reply