OK, I keep fixing things as I work on my project that uses pycdio. This PR fixes the interface of two cdtext functions. Rather than returning the raw C-structures, we ass a typemap so that the return values for can be used as normal python epxressions.
Specifically, this changes the return type of :
cdtext_list_languages_v2() to List[int]
cdtext_get() to Union[None, bytes]
The return values for cdtext_list_languages_v2() are the be interpreted as one of the (existing) CDTEXT_LANGUAGE_* constants. The CDtext format unfortunately doesn't specify a character set, so we simply return a byte string here. Decoding is left as an exercise to the reader ;)
OK, I keep fixing things as I work on my project that uses pycdio. This PR fixes the interface of two cdtext functions. Rather than returning the raw C-structures, we ass a typemap so that the return values for can be used as normal python epxressions.
Specifically, this changes the return type of :
cdtext_list_languages_v2()
toList[int]
cdtext_get()
toUnion[None, bytes]
The return values for
cdtext_list_languages_v2()
are the be interpreted as one of the (existing)CDTEXT_LANGUAGE_*
constants. The CDtext format unfortunately doesn't specify a character set, so we simply return a byte string here. Decoding is left as an exercise to the reader ;)