[riot-notifications] [RIOT-OS/RIOT] pyterm: add /sleep function (#11095)

MrKevinWeiss notifications at github.com
Tue Mar 5 13:46:29 CET 2019


MrKevinWeiss commented on this pull request.

As it is just a wrapper for sleep, it doesn't matter about code size, and people don't have to use it, I think it is fine to add it.  I will wait for others to give opinions though before moving forward.

> @@ -303,6 +303,14 @@ class SerCmd(cmd.Cmd):
         date = time.strftime("%Y-%m-%d %H:%M:%S")
         return ["%s" % (date)]
 
+    def do_PYTERM_sleep(self, line):

Small thing, why not `def do_PYTERM_sleep(self, line=1):`

> @@ -303,6 +303,14 @@ class SerCmd(cmd.Cmd):
         date = time.strftime("%Y-%m-%d %H:%M:%S")
         return ["%s" % (date)]
 
+    def do_PYTERM_sleep(self, line):
+        """Pyterm command: Sleep for n seconds.
+        """
+        if line:

then all you need is `time.sleep(float(line))`, also why do you need to cast a float, I always though python just figures these things out.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11095#pullrequestreview-210658527
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190305/5fe97bf0/attachment.html>


More information about the notifications mailing list