Eugeoter / waifuset

Mozilla Public License 2.0
105 stars 8 forks source link

[v2 version] UIBuffer didn't implement __len__ #8

Open rambda opened 3 weeks ago

rambda commented 3 weeks ago

which causes the "TypeError: object of type 'UIBuffer' has no len()" error when saving a caption.


This is most likely just a minor oversight by the author. If anyone encounters this issue, before the author fixes it, you can add the following line at line 108 in ui_utils.py:

    def __len__(self):
        return len(self.Buffer)

I'm not sure about the code logic, but this seems to work for me.

Eugeoter commented 3 weeks ago

Just fixed. Thanks for the correction.