Re: [kde] proxy settings

2011-09-09 Thread Kevin Krammer
On Friday, 2011-09-09, Osvaldo Martin wrote:
 Hi,
 
 Proxy setting can be stored in the environment variable HHTP_PROXY (I think
 this works in every Linux), but in GNOME the proxy setting could be
 configured using Network Proxy Preference in that case proxy setting are
 stored inside Gconf. KDE uses environment variable HHTP_PROXY and/or other
 place to store proxy settings?

KDE stores its proxy settings in a file called kioslaverc, usually located in
$HOME/.kde/share/config or $HOME/.kde4/share/config

Cheers,
Kevin
-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring


signature.asc
Description: This is a digitally signed message part.
___
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.

Re: [kde] proxy settings

2011-09-09 Thread Osvaldo Martin
Hi,

Googling kioslaverc I found that there is a command to read from that file,
in order to extract the http proxy settings I should use this command:

kreadconfig --file kioslaverc --group Proxy\ Settings --key httpproxy

this will return the http host and the port, If the user is ussing and
authentication proxy conecction it will give also the username and password?


It this command available by default or require the installation some extra
package?

thanks.

On Fri, Sep 9, 2011 at 4:46 AM, Osvaldo Martin aloctavo...@gmail.comwrote:

 Hi Kevin,

 Thanks for your answer

 Let me give you a little of background I am writing code in Python. The
 idea is to try to avoid asking the user to set the proxy, I already solve
 this for gnome (and may be for Windows and Mac Osx...) do you know how to
 get the proxy setting from this kioslaverc file? or may be could you send me
 an example of that file? (I am using gnome). Thanks.

 On Fri, Sep 9, 2011 at 4:26 AM, Kevin Krammer kevin.kram...@gmx.atwrote:

 On Friday, 2011-09-09, Osvaldo Martin wrote:
  Hi,
 
  Proxy setting can be stored in the environment variable HHTP_PROXY (I
 think
  this works in every Linux), but in GNOME the proxy setting co



 uld be
  configured using Network Proxy Preference in that case proxy setting
 are
  stored inside Gconf. KDE uses environment variable HHTP_PROXY and/or
 other
  place to store proxy settings?

 KDE stores its proxy settings in a file called kioslaverc, usually located
 in
 $HOME/.kde/share/config or $HOME/.kde4/share/config

 Cheers,
 Kevin
 --
 Kevin Krammer, KDE developer, xdg-utils developer
 KDE user support, developer mentoring

 ___
 This message is from the kde mailing list.
 Account management:  https://mail.kde.org/mailman/listinfo/kde.
 Archives: http://lists.kde.org/.
 More info: http://www.kde.org/faq.html.



___
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.

Re: [kde] proxy settings

2011-09-09 Thread Kevin Krammer
Hi,

On Friday, 2011-09-09, Osvaldo Martin wrote:
 Hi,
 
 Googling kioslaverc I found that there is a command to read from that file,
 in order to extract the http proxy settings I should use this command:
 
 kreadconfig --file kioslaverc --group Proxy\ Settings --key httpproxy
 
 this will return the http host and the port, If the user is ussing and
 authentication proxy conecction it will give also the username and
 password?

I guess so.

 It this command available by default or require the installation some extra
 package?

Yes, kreadconfig is part of all KDE installations.
However it only returns a value from a config file, it does not interpret the 
config.
For example the attached config is my own, but proxy is disabled (I guess 
ProxyType=0 means disabled).

If you need more information on KDE proxy handling I suggest you ask on the 
kde-core-devel mailing list.

Cheers,
Kevin

 
 thanks.
 
 On Fri, Sep 9, 2011 at 4:46 AM, Osvaldo Martin aloctavo...@gmail.comwrote:
  Hi Kevin,
  
  Thanks for your answer
  
  Let me give you a little of background I am writing code in Python. The
  idea is to try to avoid asking the user to set the proxy, I already solve
  this for gnome (and may be for Windows and Mac Osx...) do you know how to
  get the proxy setting from this kioslaverc file? or may be could you send
  me an example of that file? (I am using gnome). Thanks.
  
  On Fri, Sep 9, 2011 at 4:26 AM, Kevin Krammer kevin.kram...@gmx.atwrote:
  On Friday, 2011-09-09, Osvaldo Martin wrote:
   Hi,
   
   Proxy setting can be stored in the environment variable HHTP_PROXY (I
  
  think
  
   this works in every Linux), but in GNOME the proxy setting co
  
  uld be
  
   configured using Network Proxy Preference in that case proxy setting
  
  are
  
   stored inside Gconf. KDE uses environment variable HHTP_PROXY and/or
  
  other
  
   place to store proxy settings?
  
  KDE stores its proxy settings in a file called kioslaverc, usually
  located in
  $HOME/.kde/share/config or $HOME/.kde4/share/config
  
  Cheers,
  Kevin
  --
  Kevin Krammer, KDE developer, xdg-utils developer
  KDE user support, developer mentoring
  
  ___
  This message is from the kde mailing list.
  Account management:  https://mail.kde.org/mailman/listinfo/kde.
  Archives: http://lists.kde.org/.
  More info: http://www.kde.org/faq.html.

-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
PersistentProxyConnection=false

[$Version]
update_info=kioslave.upd:kde2.2/r1,kioslave.upd:kde2.2/r2,kioslave.upd:kde2.2/r3

[Notification Messages]
WarnOnLeaveSSLMode=false

[Proxy Settings]
AuthMode=0
NoProxyFor=
Proxy Config Script=
ProxyType=0
ReversedException=false
ftpProxy=
httpProxy=http://proxy.vc-graz.ac.at:3128
httpsProxy=


signature.asc
Description: This is a digitally signed message part.
___
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.

Re: [kde] proxy settings

2011-09-09 Thread Duncan
Kevin Krammer posted on Fri, 09 Sep 2011 17:58:53 +0200 as excerpted:

 On Friday, 2011-09-09, Osvaldo Martin wrote:
 Hi,
 
 Googling kioslaverc I found that there is a command to read from that
 file, in order to extract the http proxy settings I should use this
 command:
 
 kreadconfig --file kioslaverc --group Proxy\ Settings --key httpproxy
 
 this will return the http host and the port, If the user is ussing and
 authentication proxy conecction it will give also the username and
 password?
 
 I guess so.

@Osvaldo:  Please followup inline /under/ the part of the message you are
replying to, thus maintaining the context.  It makes further followups
/much/ easier. =:^)

As with Kevin, I don't authenticate to my (localhost-only, personal)
proxy, so can't confirm the username/password bit.  But, some more to
add...

IMPORTANT*: That should be --key httpProxy (case sensitive, uppercase P
on proxy), or it returns nothing.  See below.

 It this command available by default or require the installation some
 extra package?
 
 Yes, kreadconfig is part of all KDE installations.

FWIW, here on Gentoo, the kreadconfig binary is part of the kreadconfig
package, which is a dependency of the kdebase-startkde package.

What that means in plain English is that it will be installed as part of
the infrastructure for actually starting a kde session.  So anyone running
a kde session should have it installed (at least on Gentoo), but not
necessarily anyone simply running a kde app on some OTHER X session
(gnome, xfce, whatever), since it's not included in or a dependency of
kdelibs, a dependency on which is (by some practical definition at least)
what makes a kde app.

It's also worth noting that kde's config (as read by kreadconfig) is a
composition of data from several locations.  Normally, there will be at
least two config locations, one each in $KDEHOME and $KDEDIRS (with
appropriate defaults for each if they aren't set, often $HOME/.kde/ and
/usr/share/, but a distro may have other defaults), with the possibility
of config files in either or both locations.  It's thus possible for a
sysadmin to have a kioslaverc file at /usr/share/config/kioslaverc that
would contain settings for all users, that would be read first, so the
user settings (if present and if a value hasn't been set to prevent it)
override the system settings.

kreadconfig combines the data from all the files in all locations in the
appropriate stack-order, so the data read is the same as if a kde app was
reading it using (presumably) kdelibs functionality.  It's thus a MUCH
more appropriate way of reading the config, than to try to read it
directly from the config files yourself, even if it doesn't interpret what
it returns, that's upto the script/app calling it.

The caveat is that for kde apps installed alone, not with the
infrastructure necessary to run an entire kde session, kreadconfig might
not be available.

 However it only returns a value from a config file, it does not
 interpret the config.

Here's my user config kioslaverc here; no system kioslaverc (and the user
one is $HOME/kde/share/config/kioslaverc , no leading dot-dir, as I
dislike hidden major config dirs so set $KDEHOME appropriately, 
NoProxyFor and the httpProxy port slightly obfuscated)

-8--
AutoResume=true ConnectTimeout=20
PersistentProxyConnection=true
ProxyConnectTimeout=20
ReadTimeout=20
ResponseTimeout=40

[$Version]
update_info=kioslave.upd:kde2.2/r1,kioslave.upd:kde2.2/r3,kioslave.upd:kde2.2/r2

[Browser Settings/SMBro]
Encoding=iso 8859-1
Password=
ShowHiddenShares=false
User=
Workgroup=

[Proxy Settings]
AuthMode=0
MaxCacheSize=5120
NoProxyFor=aa,bb,cc,dd,192.168.aaa.bbb,aaa.com,www.sample.com,192.168.aaa.ccc
Proxy Config Script=
ProxyType=1
ReversedException=false
UseCache=false
cache=Reload
ftpProxy=
httpProxy=http://localhost:
httpsProxy=
-8--

Given that config ($ indicates my shell prompt):

$kreadconfig --file kioslaverc --group Proxy Settings --key httpproxy 


$kreadconfig --file kioslaverc --group Proxy Settings --key httpProxy   
   
http://localhost:
$


Note both the quoting of Proxy Settings so it is passed by the shell
as a single parameter, and that the whole thing is case sensitive
(httpproxy as the key returned nothing, neither would proxy settings
as the group, or KIOSlaverc, since in each case that refers to an
entirely different and here non-existing object).

-- 
Duncan - List replies preferred.   No HTML msgs.
Every nonfree program has a lord, a master --
and if you use the program, he is your master.  Richard Stallman

___
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: 

Re: [kde] proxy settings

2011-09-09 Thread Osvaldo Martin
Thanks Ducan,

your answer and Kevin`s answer were really helpfull!

What I am going to do is to check if the user is using Linux* and In that
case I will try to get the proxy settings from http_proxy environment
variable or from gconf or from  kioslaverc. And if everything fail I will
ask the user to provided the correct proxy settings (I think this is a fair
solution because on one hand I think most linux users know what a proxy is
and on the other hand at least I tried to get things easier for them :-) )

Probably I will download a KDE distribution to test my code or at least I
will find someone using KDE (and willing to do a test for me).

* (I use a python library call mechanize, in Windows and Mac OsX, this
library reads the proxy setting from windows registry and some MacOsX
registry)


On Fri, Sep 9, 2011 at 8:50 PM, Duncan 1i5t5.dun...@cox.net wrote:

 Kevin Krammer posted on Fri, 09 Sep 2011 17:58:53 +0200 as excerpted:

  On Friday, 2011-09-09, Osvaldo Martin wrote:
  Hi,
 
  Googling kioslaverc I found that there is a command to read from that
  file, in order to extract the http proxy settings I should use this
  command:
 
  kreadconfig --file kioslaverc --group Proxy\ Settings --key httpproxy
 
  this will return the http host and the port, If the user is ussing and
  authentication proxy conecction it will give also the username and
  password?
 
  I guess so.

 @Osvaldo:  Please followup inline /under/ the part of the message you are
 replying to, thus maintaining the context.  It makes further followups
 /much/ easier. =:^)

 As with Kevin, I don't authenticate to my (localhost-only, personal)
 proxy, so can't confirm the username/password bit.  But, some more to
 add...

 IMPORTANT*: That should be --key httpProxy (case sensitive, uppercase P
 on proxy), or it returns nothing.  See below.

  It this command available by default or require the installation some
  extra package?
 
  Yes, kreadconfig is part of all KDE installations.

 FWIW, here on Gentoo, the kreadconfig binary is part of the kreadconfig
 package, which is a dependency of the kdebase-startkde package.

 What that means in plain English is that it will be installed as part of
 the infrastructure for actually starting a kde session.  So anyone running
 a kde session should have it installed (at least on Gentoo), but not
 necessarily anyone simply running a kde app on some OTHER X session
 (gnome, xfce, whatever), since it's not included in or a dependency of
 kdelibs, a dependency on which is (by some practical definition at least)
 what makes a kde app.

 It's also worth noting that kde's config (as read by kreadconfig) is a
 composition of data from several locations.  Normally, there will be at
 least two config locations, one each in $KDEHOME and $KDEDIRS (with
 appropriate defaults for each if they aren't set, often $HOME/.kde/ and
 /usr/share/, but a distro may have other defaults), with the possibility
 of config files in either or both locations.  It's thus possible for a
 sysadmin to have a kioslaverc file at /usr/share/config/kioslaverc that
 would contain settings for all users, that would be read first, so the
 user settings (if present and if a value hasn't been set to prevent it)
 override the system settings.

 kreadconfig combines the data from all the files in all locations in the
 appropriate stack-order, so the data read is the same as if a kde app was
 reading it using (presumably) kdelibs functionality.  It's thus a MUCH
 more appropriate way of reading the config, than to try to read it
 directly from the config files yourself, even if it doesn't interpret what
 it returns, that's upto the script/app calling it.

 The caveat is that for kde apps installed alone, not with the
 infrastructure necessary to run an entire kde session, kreadconfig might
 not be available.

  However it only returns a value from a config file, it does not
  interpret the config.

 Here's my user config kioslaverc here; no system kioslaverc (and the user
 one is $HOME/kde/share/config/kioslaverc , no leading dot-dir, as I
 dislike hidden major config dirs so set $KDEHOME appropriately,
 NoProxyFor and the httpProxy port slightly obfuscated)

 -8--
 AutoResume=true ConnectTimeout=20
 PersistentProxyConnection=true
 ProxyConnectTimeout=20
 ReadTimeout=20
 ResponseTimeout=40

 [$Version]

 update_info=kioslave.upd:kde2.2/r1,kioslave.upd:kde2.2/r3,kioslave.upd:kde2.2/r2

 [Browser Settings/SMBro]
 Encoding=iso 8859-1
 Password=
 ShowHiddenShares=false
 User=
 Workgroup=

 [Proxy Settings]
 AuthMode=0
 MaxCacheSize=5120
 NoProxyFor=aa,bb,cc,dd,192.168.aaa.bbb,aaa.com,www.sample.com
 ,192.168.aaa.ccc
 Proxy Config Script=
 ProxyType=1
 ReversedException=false
 UseCache=false
 cache=Reload
 ftpProxy=
 httpProxy=http://localhost:
 httpsProxy=
 -8--

 Given that config ($ indicates my shell prompt):

 $kreadconfig --file kioslaverc --group Proxy Settings --key 

[kde] proxy settings

2011-09-08 Thread Osvaldo Martin
Hi,

Proxy setting can be stored in the environment variable HHTP_PROXY (I think
this works in every Linux), but in GNOME the proxy setting could be
configured using Network Proxy Preference in that case proxy setting are
stored inside Gconf. KDE uses environment variable HHTP_PROXY and/or other
place to store proxy settings?

Thanks.
___
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.