metwork-framework / mfdata

metwork/mfdata module
http://metwork-framework.org/
BSD 3-Clause "New" or "Revised" License
6 stars 4 forks source link

use new mfutil.eval in switch plugin #242

Closed thefab closed 4 years ago

thefab commented 4 years ago

thanks to @moas

thefab commented 4 years ago

I revert this as it does not work for the moment because Bytes are not supported in simpleeval :-(

I keep the original work here: https://github.com/metwork-framework/mfdata/pull/245

thefab commented 4 years ago

work done in mfutil (thanks to @moas), we have to update mfutil in mfext and we would be able to unblock this

thefab commented 4 years ago

done

thefab commented 4 years ago

reopen because of #254

thefab commented 4 years ago

this test is mfutil test_eval.py should pass:

    def test_bytes_in_variables(self):
        self.t("x['foo'].startswith(b'png')", {'x': {'foo': b'png'}}, True)

but we get:

TypeError: startswith first arg must be bytes or a tuple of bytes, not str
thefab commented 4 years ago

closed thanks to @moas patch in mfutil