there are normal faces and textured faces in Blender, both currently
with their own selection and visibility states, due to a mix of old and
new code. To (un)select or (un)hide normal faces (visible in editmode),
use sel and hide
variables. For textured faces (Face Select mode in Blender) use the old
flag
bitflag. Also check the example above and note Window.EditMode.

Assigning uv textures to mesh faces in Blender works like this:

Select your mesh.

Enter face select mode (press f) and select at least some
face(s).

In the UV/Image Editor window, load / select an image.

Play in both windows (better split the screen to see both at the
same time) until the uv coordinates are where you want them. Hint: in
the 3d window, the 'u' key opens a menu of default uv choices and the
'r' key lets you rotate the uv coordinates.