kiwiz / gkeepapi

An unofficial client for the Google Keep API.
MIT License
1.52k stars 112 forks source link

How to parameterize the color in gkeepapi.node.ColorValue.Yellow ? #139

Closed haisamido closed 11 months ago

haisamido commented 1 year ago

I want to parameterize Yellow, as in _color='Yellow' and then use it like this:

note.color = "gkeepapi.node.ColorValue."+_color

but when I do that I get:

  File "/usr/local/lib/python3.10/site-packages/gkeepapi/node.py", line 1206, in save
    ret['color'] = self._color.value
AttributeError: 'str' object has no attribute 'value'
kiwiz commented 1 year ago

ColorValue is an enum, so you can do ColorValue(color)