Package AccessGrid :: Package Platform :: Package win32 :: Module Config :: Class SystemConfig
[show private | hide private]
[frames | no frames]

Class SystemConfig

SystemConfig --+
               |
              SystemConfig


The SystemConfig object encapsulates all system dependent configuration data, it should be extended to retrieve and store additional information as necessary.
Method Summary
  __init__(self)
  AppFirewallConfig(self, path, enableFlag)
This method pokes the windows registry to enable or disable an application in the firewall config.
  EnumerateInterfaces(self)
Enumerate the interfaces present on a windows box.
  FindRegistryEnvironmentVariable(self, varname)
Find the definition of varname in the registry.
  GetFileSystemFreeSpace(self, path)
Retrieve the amount of free space on the file system the path is housed on.
  GetLocalIPAddress(self)
Get our IP address.
  GetProxySettings(self)
If the system has a proxy server defined for use, return its address.
  GetResources(self)
Return a list of the resources available on the system
  GetTempDir(self)
Get the path to the system temp directory.
  GetUsername(self)
Get the name of the user
  instance()
(Static method)
  PerformanceSnapshot(self)
This method grabs a snapshot of relevent system information to report it.
  SendSettingChange(self)
This updates all windows with registry changes to the HKCU\Environment key.
    Inherited from SystemConfig
  __str__(self)
  _repr_(self)
  CheckClock(self, limit)
Retrieve the SNTP time and compare this clock against it.
  GetHostname(self)
Retrieve the local hostname.
  _GetSNTPTime(self, server, timeout)
Retrieve the time from the given time server, with a timeout.

Instance Variable Summary
string tempDir: the system temp directory.

Class Variable Summary
SystemConfig theSystemConfigInstance = <AccessGrid.Platform.win32.Con...

Instance Method Details

AppFirewallConfig(self, path, enableFlag)

This method pokes the windows registry to enable or disable an application in the firewall config.
Overrides:
AccessGrid.Config.SystemConfig.AppFirewallConfig

EnumerateInterfaces(self)

Enumerate the interfaces present on a windows box.

Run ipconfig /all
Overrides:
AccessGrid.Config.SystemConfig.EnumerateInterfaces

FindRegistryEnvironmentVariable(self, varname)

Find the definition of varname in the registry.

Returns the tuple (global_value, user_value).

We can use this to determine if the user has set an environment variable at the commandline if it's causing problems.

GetFileSystemFreeSpace(self, path)

Retrieve the amount of free space on the file system the path is housed on.
Overrides:
AccessGrid.Config.SystemConfig.GetFileSystemFreeSpace

GetLocalIPAddress(self)

Get our IP address. We use the heuristic that the address we want to advertise is the one that corresponds to the active default route. If there isn't a default route, pick the lowest-metric interface from the routing table. If we don't have anything there, return 127.0.0.1
Overrides:
AccessGrid.Config.SystemConfig.GetLocalIPAddress

GetProxySettings(self)

If the system has a proxy server defined for use, return its address. The return value is actually a list of tuples (server address, enabled). There are at least two places to look for these values.

WinHttp defines a proxy at

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\WinHttpSettings

Unfortunately it stores its value as a binary string; it's meant to be accessed via the WinHttpGetDefaultProxyConfiguration call or by the proxycfg.exe program. For now, we'll just use the IE setting:

IE defines a proxy at:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings

The key ProxyServer has the name of the proxy, and ProxyEnable is nonzero if it is enabled for use.

If there are different proxies for different protocols, the ProxyServer key will look like this:

ftp=ftpp:2345;gopher=gopherp:3456;http=yips:8080;https=securep:1234;socks=socksp:4567

If it is set to use the same server for all protocols, it will look like this:

yips:8080
Overrides:
AccessGrid.Config.SystemConfig.GetProxySettings

GetResources(self)

Return a list of the resources available on the system

GetTempDir(self)

Get the path to the system temp directory.
Overrides:
AccessGrid.Config.SystemConfig.GetTempDir

GetUsername(self)

Get the name of the user
Overrides:
AccessGrid.Config.SystemConfig.GetUsername (inherited documentation)

PerformanceSnapshot(self)

This method grabs a snapshot of relevent system information to report it. This helps track the effect of the AG Toolkit on the system.

SendSettingChange(self)

This updates all windows with registry changes to the HKCU\Environment key.

Instance Variable Details

tempDir

the system temp directory.
Type:
string

Class Variable Details

theSystemConfigInstance

Type:
SystemConfig
Value:
<AccessGrid.Platform.win32.Config.SystemConfig instance at 0x0360ADC8> 

Generated by Epydoc 2.1 on Thu Apr 14 16:39:31 2005 http://epydoc.sf.net