Changes between Version 110 and Version 111 of RepyTutorial

Changes between Version 110 and Version 111 of RepyTutorial

Please note that these Trac pages are no longer being updated. Wiki contents/documentation have moved to GitHub.

Changes between Version 110 and Version 111 of RepyTutorial

Please note that these Trac pages are no longer being updated. Wiki contents/documentation have moved to GitHub.

Changes between Version 110 and Version 111 of RepyTutorial

Show
Ignore:
Timestamp:
04/08/16 09:05:04 (18 months ago)
Author:
lukasp
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RepyTutorial

    v110 v111  
    840840# this unpacks the data from the packet and changes it to a float 
    841841def convert_timestamp_to_float(timestamp):    
    842   integerpart = (ord(timestamp[0])<<24) + (ord(timestamp[1])<<16) 
    843                  + (ord(timestamp[2])<<8) + (ord(timestamp[3])) 
    844   floatpart = (ord(timestamp[4])<<24) + (ord(timestamp[5])<<16) 
    845                + (ord(timestamp[6])<<8) + (ord(timestamp[7])) 
     842  integerpart = (ord(timestamp[0])<<24) + (ord(timestamp[1])<<16) + \ 
     843      (ord(timestamp[2])<<8) + (ord(timestamp[3])) 
     844  floatpart = (ord(timestamp[4])<<24) + (ord(timestamp[5])<<16) + \ 
     845      (ord(timestamp[6])<<8) + (ord(timestamp[7])) 
    846846  return integerpart + floatpart / float(2**32) 
    847847 
     
    854854if callfunc == 'initialize': 
    855855  ip = getmyip() 
    856   timeservers = ["time-a.nist.gov", "time-b.nist.gov", "time-a.timefreq.bldrdoc.gov",  
    857                  "time-b.timefreq.bldrdoc.gov", "time-c.timefreq.bldrdoc.gov",  
    858                  "utcnist.colorado.edu", "time.nist.gov", "time-nw.nist.gov",  
    859                  "nist1.symmetricom.com", "nist1-dc.WiTime.net", "nist1-ny.WiTime.net",  
    860                  "nist1-sj.WiTime.net", "nist.expertsmi.com", "nist.netservicesgroup.com"] 
     856  timeservers = ["time-a.nist.gov", "time-b.nist.gov", 
     857      "time-a.timefreq.bldrdoc.gov", "time-b.timefreq.bldrdoc.gov",  
     858      "time-c.timefreq.bldrdoc.gov", "utcnist.colorado.edu", "time.nist.gov",  
     859      "time-nw.nist.gov", "nist1.symmetricom.com", "nist1-dc.WiTime.net",  
     860      "nist1-ny.WiTime.net", "nist1-sj.WiTime.net", "nist.expertsmi.com",  
     861      "nist.netservicesgroup.com"] 
    861862 
    862863  # choose a random time server from the list