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 24 Apr 2014, 23:26
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Pwget for Dingo (Lobster attempts to program)
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [19 Posts]   Goto page: 1, 2 Next
Author Message
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Sun 06 Jan 2008, 02:38    Post subject:  Pwget for Dingo (Lobster attempts to program)
Subject description: Help!
 


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:
wget -c -P$DEST $SOURCE



and this is the front end
Code:
#! /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 WIKI
Back to top
View user's profile Send private message Visit poster's website 
zigbert


Joined: 29 Mar 2006
Posts: 5564
Location: Valåmoen, Norway

PostPosted: Sun 06 Jan 2008, 05:40    Post subject:  

Would this help
Code:

#! /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

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Sun 06 Jan 2008, 08:33    Post subject:  

Many thanks Zigbert

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

Code:
exec wget -c -P $DEST $SOURCE

. . . so it works

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

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

So the code stands as

Code:
#! /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 WIKI
Back to top
View user's profile Send private message Visit poster's website 
zigbert


Joined: 29 Mar 2006
Posts: 5564
Location: Valåmoen, Norway

PostPosted: Sun 06 Jan 2008, 08:53    Post subject:  

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:
exec wget -c -P $DEST $SOURCE
should be
Code:
exec wget -c -P "$DEST" $SOURCE
This to accept paths with spaces in name.

Happy coding Very Happy
Sigmund

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
mcewanw

Joined: 16 Aug 2007
Posts: 2022
Location: New Zealand

PostPosted: Sun 06 Jan 2008, 18:31    Post subject: Make it voice controllable and speaking  

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! Smile

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.
Back to top
View user's profile Send private message Visit poster's website 
trapster


Joined: 28 Nov 2005
Posts: 1997
Location: Maine, USA

PostPosted: Sun 06 Jan 2008, 19:00    Post subject:  

Go Lobster go !!!!!!

FYI
Xwget can be found in puppy under the "internet" menu.

_________________
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Puppeee4.31 + 1.0, Puppy4.10 + Lupu52
Currently using Slacko AND lupu52 w/ fluxbox
Back to top
View user's profile Send private message Visit poster's website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Mon 07 Jan 2008, 03:34    Post subject:  

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.

_________________
http://bkhome.org/news/
Back to top
View user's profile Send private message Visit poster's website 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Mon 07 Jan 2008, 20:28    Post subject:  

Quote:
Go Lobster go !!!!!!
Laughing

Quote:
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 Rolling Eyes ) 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:
#! /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

_________________
Puppy WIKI

Last edited by Lobster on Tue 08 Jan 2008, 03:54; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
cb88


Joined: 28 Jan 2007
Posts: 1169
Location: USA

PostPosted: Mon 07 Jan 2008, 23:05    Post subject:  

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 Smile

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
Back to top
View user's profile Send private message Visit poster's website 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Tue 08 Jan 2008, 04:04    Post subject:  

cb88 wrote:
how about adding a mirror function?


m m m . . .
here is me combing my whiskers in front of the mirror . . .


Not what you meant? Embarassed

. . . 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 WIKI
Back to top
View user's profile Send private message Visit poster's website 
cb88


Joined: 28 Jan 2007
Posts: 1169
Location: USA

PostPosted: Tue 08 Jan 2008, 08:45    Post subject:  

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 Sad

_________________
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
Back to top
View user's profile Send private message Visit poster's website 
Dingo


Joined: 11 Dec 2007
Posts: 1411
Location: somewhere at the end of rainbow...

PostPosted: Tue 08 Jan 2008, 09:27    Post subject:  

works fine for me on Puppy 3.01
Back to top
View user's profile Send private message Visit poster's website 
jcoder24


Joined: 06 May 2005
Posts: 601
Location: Barbados

PostPosted: Tue 08 Jan 2008, 09:40    Post subject:  

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.
Back to top
View user's profile Send private message 
cb88


Joined: 28 Jan 2007
Posts: 1169
Location: USA

PostPosted: Tue 08 Jan 2008, 13:49    Post subject:  

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
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Wed 16 Jan 2008, 06:56    Post subject:  

Dotpup:
http://dotpups.de/dotpups/Internet/Pwget.pup
mirror:
http://puppyfiles.ca/dotpupsde/dotpups/Internet/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
Pwget.jpg
 Description   screenshot
 Filesize   50.29 KB
 Viewed   1854 Time(s)

Pwget.jpg

Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 2 [19 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
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.1092s ][ Queries: 13 (0.0114s) ][ GZIP on ]