No subject


Mon Mar 15 02:42:15 EDT 2010


> + =C2=A0 =C2=A0 =C2=A0 =C2=A0vbox.pack_start(self._status_text, padding=
=3D10)

The padding shouldn't be hardcoded to a number of pixels, see the
constants in style.py.  (maybe padding=3Dstyle.DEFAULT_PADDING?)

> +def get_touchpad():
> + =C2=A0 =C2=A0""" Get the touchpad mode. """
> + =C2=A0 =C2=A0_file_handle =3D open(_NODE_PATH, "r")
> + =C2=A0 =C2=A0_text =3D _file_handle.read()
> + =C2=A0 =C2=A0_file_handle.close()

Maybe put this is a try... block?

> + =C2=A0 =C2=A0if touchpad =3D=3D 'capacitive':
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0if path.exists(_FLAG_PATH):
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0remove(_FLAG_PATH)
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0system("echo 0 > %s" % (_NODE_PATH))
> + =C2=A0 =C2=A0else:
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0_file_handle =3D open(_FLAG_PATH, "w")
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0_file_handle.close()
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0system("echo 1 > %s" % (_NODE_PATH))
> + =C2=A0 =C2=A0return

Tomeu will nag you about "" vs. '' in the system(...) calls ;)


More information about the Sugar-devel mailing list