Rudy's personal scratchpad 1.4.2004

2004-04-01

How far can you go in customizing PyDS?

Just some things I'd have to find out:

  • Can you configure different "categories" of Pictures? Or, how would I separate the pictures from my last trip to Italy and those of my daughter's birthday party?
  • Is it possible to have different style-sheets per Category. Can I have comments and backtracks enabled for one and disabled for another category?
  • Can I have different upstream settings per category? The normal text ones to PyCS and the photos via FTP to my iSP webspace? Or should I try to have two instances of PyDS running at different ports?
  • Can I easily extend PyDS to fetch my email from my POP server?
posted at 18:04:16    #    comment []    trackback []
 

Need to solve the proxy problem (not only for PyDS)

First of all I'll explain why I have a problem with proxies. When I'm working at home I could use the ISP's proxyserver but I don't need to. When I'm working at the office I MUST use a proxyserver, but which one depends on the location. Fortunatley my company provides an autoproxy configuration script. When I'm working on a customer's LAN it all depends. Some do not allow Internet access, other don't need proxy servers, some have a fixed proxyserver and only a few use autoconfig scripts.

The problem I'm facing now is that I don't have a solution for all situations.

I've been looking at how urllib.py determines which proxy server it should use for which protocol, and I can't say I'm happy about it. The getproxies function first looks if there are environment variables of the form protocol_proxy (e.g. http_proxy) and uses those if found. If not, it looks in the Windows registry (HKCUSoftwareMicrosoftWindowsCurrentVersionInternet Settings) for ProxyEnable and ProxyServer.

Because I'm running PyDS as a service (as LocalSystem) (thanks to Georg) now, I not even sure which user is used in the registry (certainly not myself). I could run the service under my own accoutn and have that problem solved, but then I shouldn't forget to go and change the password for the service each time I renew mine. The environment variables are problematic too because Localsystem only sees changes at the next reboot. Changing to my useraccount would mean that I would need to restart the service every time the proxy settings change.

So, suppose I change the sevice account for PyDS into mine, I would still have a problem because in some of the situations I'd have to use a autoproxy configscript in which case I'd have to clear the ProxyEnable registry setting. I'll have to think about this one.

I change networks at least 3 times a day when working and I almost never reboot my laptop. This brings me to the next challenge: changing the proxy settings automagically. Now, that shouldn't be too hard. I can create a configuration table containing the correct proxy settings for each network I'm on ( combination of IP-range and domainname). I could write a PyDS-tool that checks the network every minute (shoudn't be that hard) and then changes the proxy settings according to the network I'm on at that moment.

posted at 17:21:36    #    comment []    trackback []
April 2004
MoTuWeThFrSaSu
    1 2 3 4
5 6 7 8 91011
12131415161718
19202122232425
2627282930  
Mar
2004
 May
2004

Feel free to read what I drop here, but don't expect to find something thrilling. I'm just learning Python and discovering PyDS, the perfect combination, isn't it.

XML-Image Letterimage

© 2004, Rudy Schockaert