Search found 16 matches

by shawwwn
Tue Sep 18, 2018 3:03 pm
Forum: Programs, Libraries and Tools
Topic: uMail - A lightweight SMTP client for MicroPython
Replies: 33
Views: 31662

uMail - A lightweight SMTP client for MicroPython

I was trying to port smtplib but then found out it was too bloated, so I ended up writing my own. https://github.com/shawwwn/uMail The API was designed in a way so that it can accommodate sending long emails in a memory constrained system. There is no pre-defined options for email headers(from/to/su...
by shawwwn
Tue Sep 11, 2018 8:13 am
Forum: Development of MicroPython
Topic: [SOLVED] static/class method in micropython?
Replies: 3
Views: 3443

Re: static/class method in micropython?

Nvm. I found it.

Inside py/obj.h,
there is a macro called

Code: Select all

MP_DEFINE_CONST_STATICMETHOD_OBJ
which puts a staticmethod wrap onto a function.

Thanks for the help!
I'm closing this issue.
by shawwwn
Tue Sep 11, 2018 7:44 am
Forum: Development of MicroPython
Topic: [SOLVED] static/class method in micropython?
Replies: 3
Views: 3443

Re: static/class method in micropython?

Nice. Thanks for pointing that out.

I am finding a way to implement static method in a python class written in C.
Any ideas how it can be done?
by shawwwn
Tue Sep 11, 2018 6:31 am
Forum: Development of MicroPython
Topic: [SOLVED] static/class method in micropython?
Replies: 3
Views: 3443

[SOLVED] static/class method in micropython?

Judging from the source, currently class method in micropython is not supported.
The underlying C struct of mp class instance only has .locals_dict.

Any plans to add support for class or static method?
This feature would be really useful for module developers.

Thanks.
by shawwwn
Wed Feb 07, 2018 6:00 am
Forum: Programs, Libraries and Tools
Topic: ainput - asynchronous user input libraries based on uasyncio
Replies: 2
Views: 2878

Re: ainput - asynchronous user input libraries based on uasyncio

That's really exciting and interesting. Is there a technical reason uaiorepl can't be wired to the 'real' REPL, anyone? It seems there are multiple places in the source code that would block/deny user input when something is running in repl. However, the underlying issue here I think is the design ...
by shawwwn
Tue Feb 06, 2018 5:58 am
Forum: Programs, Libraries and Tools
Topic: ainput - asynchronous user input libraries based on uasyncio
Replies: 2
Views: 2878

ainput - asynchronous user input libraries based on uasyncio

I have been experimenting MicroPython on my ESP8266 for the past few days. I needed to do some multitasking for my project however it seems there is no easy way to do it. uasyncio turns out to be a great alternative to threads, however it blocks user input when an event loop is running. I wrote a se...