Search found 47 matches

by cgglzpy
Fri Jan 17, 2020 4:56 pm
Forum: Development of MicroPython
Topic: Tree command for upysh
Replies: 8
Views: 5552

Re: Tree command for upysh

Hi, I made a 'display disk usage statistics' / 'du' command too, in case anyone is interested... It's like 'ls' command but size is in 'Human-readable' output, by default do not list hidden files/dirs, it prints also size of dirs and it has an option for the depth level (default 0) e.g. >>> du 8.3 K...
by cgglzpy
Fri Jan 17, 2020 3:33 pm
Forum: General Discussion and Questions
Topic: How to run an mqtt-repl?
Replies: 22
Views: 14395

Re: How to run an mqtt-repl?

That looks good! :) That looks really helpful! I have a couple of questions: - why do you first try to eval and then exec? why not eval(compile(self.rec_msg)) ? - why do you call gc.collect() when there is no output? As I said it was experimental (aka "I have the ideas but I don't know how to implem...
by cgglzpy
Thu Jan 16, 2020 10:09 pm
Forum: General Discussion and Questions
Topic: How to run an mqtt-repl?
Replies: 22
Views: 14395

Re: How to run an mqtt-repl?

Hmm, I see... About #1 In that case you may want to have a look at some experimental work I did before the ssl repl : upysecrets.py I think that the 'CRYPTOGRAPHER' class method 'crepl' can be adapted to work with MQTT with some changes (ignoring the decryption/encryption steps and instead of return...
by cgglzpy
Thu Jan 16, 2020 7:49 pm
Forum: General Discussion and Questions
Topic: How to run an mqtt-repl?
Replies: 22
Views: 14395

Re: How to run an mqtt-repl?

I'm trying to write an MQTT Repl that accepts input by subscribing to a topic (the message payload is simply repl input) and that writes output to another topic (again, the message payload is simply repl output) This would be a very nice one to have :) I don't know about the uasyncio part, but to m...
by cgglzpy
Thu Jan 16, 2020 7:22 pm
Forum: General Discussion and Questions
Topic: Partial mac address ?
Replies: 4
Views: 2732

Re: Partial mac address ?

Hi, just mention that MicroPython introduced a separator option for binascii.hexlify function which is quite nice for this case: >>> from binascii import hexlify >>> hexlify(b'$b\xab\xd4\xce\xe8', ':') b'24:62:ab:d4:ce:e8' Or >>> hexlify(b'$b\xab\xd4\xce\xe8', ':').decode() '24:62:ab:d4:ce:e8' In ca...
by cgglzpy
Mon Jan 13, 2020 3:34 pm
Forum: Programs, Libraries and Tools
Topic: SSL(Web)REPL + SHELL
Replies: 2
Views: 2183

Re: SSL(Web)REPL + SHELL

Hi, thanks I forgot to mention that file transfer (get/put commands) are also done over SSL and SHELL / REPL comes with all sort of autocompletions :) This looks very promising! I'm tired of all the insecure protocols everywhere... Thanks for sharing! I don't know if this is "secure" or not, but I g...
by cgglzpy
Sun Jan 12, 2020 1:43 pm
Forum: Programs, Libraries and Tools
Topic: SSL(Web)REPL + SHELL
Replies: 2
Views: 2183

SSL(Web)REPL + SHELL

Hi, I somehow managed to make a REPL / SHELL that works over SSL, which basically looks like this : https://raw.githubusercontent.com/Carglglz/upydev/master/DOCS/SSLWebREPL_demo.gif It still NEEDS WebREPL enabled for the initial logging and after that the SSL REPL is initiated ("os.dupterm" on a ssl...
by cgglzpy
Thu Jan 09, 2020 3:42 pm
Forum: Development of MicroPython
Topic: Tree command for upysh
Replies: 8
Views: 5552

Re: Tree command for upysh

On a quick test the Linux implementation of tree ignores hidden files and directories. So I suggest changing this line to: l = [x for x in os.listdir(path) if not x.startswith('.')] That fixes the problem here. I came to the same conclusion yesterday after a quick look so it ignores the hidden file...
by cgglzpy
Wed Jan 08, 2020 5:42 pm
Forum: Development of MicroPython
Topic: Tree command for upysh
Replies: 8
Views: 5552

Re: Tree command for upysh

Hi, thanks I've just submitted the PR That is very useful indeed, especially for those who use Python packages. :D On a Pyboard with an SD card there is a problem: it lists the contents of .Trash-1000 which (on my SD card) are huge. It would be good if there were some way to disable this - an option...
by cgglzpy
Tue Jan 07, 2020 8:41 pm
Forum: Development of MicroPython
Topic: Tree command for upysh
Replies: 8
Views: 5552

Tree command for upysh

Hi I made TREE class for upysh (using LS as a template) So doing >>> from upysh import * Then you will be able to do this >>> tree ATEXTFILE.txt THETESTCODE.py my_other_dir_sync <dir> └──── another_file.txt new_tree_test_dir <dir> ├──── example_code.py ├──── foo_file.txt ├──── sub_foo_test_dir <dir>...