Skip to content

Commit 3a0bda2

Browse files
committed
fixing ChronodotSet ntp script; set scripts will only listen to the time 5 times and exit
1 parent 6c5c5f3 commit 3a0bda2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ChronodotSet/set_localtime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@
4747
print 'Set time to %s' % tm
4848

4949
# keep reading and displaying time
50-
while(True):
50+
for i in range(0, 5):
5151
sys.stdout.write(serial.readline())
5252

ChronodotSet/set_ntp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020

2121
# needs http://pypi.python.org/pypi/ntplib/
2222

23-
import serial, sys, ntplib
24-
from time import ctime
23+
import serial, sys, ntplib, time
2524

2625

2726
# get TZ offset from command line param
@@ -54,6 +53,7 @@
5453
print 'Set time to %s' % tm
5554

5655
# keep reading and displaying time
57-
while(True):
56+
for i in range(0, 5):
5857
sys.stdout.write(serial.readline())
58+
time.sleep(1)
5959

0 commit comments

Comments
 (0)