gtojty / pyemread

package for creating bitmaps, region files, and analyzing ascii eye-movement data
2 stars 1 forks source link

Praster() "text" argument #7

Closed davebraze closed 8 years ago

davebraze commented 8 years ago

The "text" argument to Praster() must be a list even if it contains a single string.

At present, Praster does not check to ensure that 'text' is a list and exhibits improper behavior if 'text' is a bare string.

FIX: Praster() should check whether 'text' is a string and exit with an informative error if it is. Something like this may work:

if isinstance(text, basestring): 
    ## throw error
    ## exit function
gtojty commented 8 years ago

I now add one judgement whether text is a list(or tuple) not a bare string.