[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-edu-devel
Subject:    [kde-edu-devel] Fwd: kvoctrain/langen2kvtml patch
From:       Kevin Krammer <kevin.krammer () gmx ! at>
Date:       2002-11-21 22:37:35
[Download RAW message or body]



----------  Forwarded Message  ----------

Subject: kvoctrain/langen2kvtml patch
Date: Fri, 22 Nov 2002 09:12:33 +1100
From: Ben Burton <bab@debian.org>
To: kde-devel@kde.org
Cc: kvoctrain@ewald-arnold.de

Hi.  May I commit the following patch to the langen2kvtml script (part of
kdeedu/kvoctrain)?

Currently if you run the script with no options it will try to download
 vocab files from the net.

The proxy is hard-wired as http://proxy:8080/, a relative host that in
 general will not exist. To change the proxy you must specify

  langen2kvtml "--proxy=-p http://otherhost:port/"

which is unintuitive, error-prone (requires quoting) and not actually
 shown in the langen2kvtml usage string.

What this patch does is:

1. Make the default be to use no proxy at all, instead of (in many cases)
generating an invalid hostname error by default;
2. If you do want a proxy, allow it to be specified as
--proxy=http://host:port/, i.e., don't require the extra -p in the proxy
string.

Thanks - Ben.

Index: kdeedu/kvoctrain/kvoctrain/langen2kvtml
===================================================================
RCS file: /home/kde/kdeedu/kvoctrain/kvoctrain/langen2kvtml,v
retrieving revision 1.2
diff -u -3 -p -r1.2 langen2kvtml
--- kdeedu/kvoctrain/kvoctrain/langen2kvtml	2001/12/22 09:06:05	1.2
+++ kdeedu/kvoctrain/kvoctrain/langen2kvtml	2002/11/21 22:06:00
@@ -71,7 +71,7 @@ $outdir 	= $cwd;		 		# Where the output
 $langdefault	= "en";		# My favorite is English
 $trans		= "de";		# My favorite is Deutsch
 $longlesson	= 0;		# as you like
-$proxy		= "-p http://proxy:8080/";
+$proxy		= "";

 #######################################################################
 # No User configurable parameters below here
@@ -142,6 +142,11 @@ if ( ! &GetOptions(
    exit 1;
 }

+# Fix the proxy option if it has been given
+if ($proxy) {
+    $proxy = "-p $proxy";
+}
+
 # Get input file name if it has been given
 if ($ARGV[0] eq '' &&  $country eq "") {
     print STDERR "Error: no input filename.\n";
@@ -159,7 +164,9 @@ $tmp1=$#ARGV+1;

 if ( $country ne "" ) {
     &printflush(STDOUT,"... fetching
http://www.vokabeln.de/files/Voc-$country.zip ...\n");
-    &printflush(STDOUT,"... using proxy service $proxy ...\n");
+    if ($proxy) {
+        &printflush(STDOUT,"... using proxy service $proxy ...\n");
+    }
     `lwp-request $proxy http://www.vokabeln.de/files/Voc-$country.zip

>/tmp/Voc-$country.zip`;

     # unzip -u update only!
     # unzip -o overwrite!

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
>> unsubscribe <<

-------------------------------------------------------

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kevin Krammer <kevin.krammer@gmx.at>
Developer at the Kmud Project http://www.kmud.de/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_______________________________________________
kde-edu-devel mailing list
kde-edu-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-edu-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic