Make a sort of convenience function in sh.shell.

Fix the regular expression to check if the camera can not be found. Also
switch to a few other python idioms.