[Officeshots] [Symbian]gloadavg

Sander Marechal s.marechal at jejik.com
Wed Mar 11 16:47:25 CET 2009


Maximilian Odendahl wrote:
> as there is no getloadavg on Symbian, should this just jump into the 
> except block every time or would it be better to do sth. like
> 
> if platform.sytem() != 'Symbian':
> 	....
> else:
> 	return 0

I'm not fond of platform-specific code. It's probably better to catch
the exception in Factory.systemload() but have it return 0 instead of None.

def systemload(self):
	try:
		return max(os.getloadavg())
	except (AttributeError, OSError):
		return 0

-- 
Sander Marechal


More information about the Officeshots mailing list