Changeset 179 in tmcsimulator for trunk/src/tmcsim


Ignore:
Timestamp:
10/26/2017 09:01:24 AM (9 years ago)
Author:
jdalbey
Message:

ATMSrenumber.py added. Improve formatting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tmcsim/client/ATMSrenumber.py

    r178 r179  
    1818    # read a line and output with :00 secs 
    1919    str = raw_input(""); 
    20     t = (2009, 2, 17, 0, mincount, 0, 1, 0, 0) 
    21     t = time.mktime(t) 
    22     print time.strftime("%H:%M:%S", time.gmtime(t)), str 
     20    if str[0] != '#': 
     21        fields = str.split() 
     22        t = (2009, 2, 17, 0, mincount, 0, 1, 0, 0) 
     23        t = time.mktime(t) 
     24#        print fields[0], time.strftime("%H:%M:%S", time.gmtime(t)), fields[2], "\t", fields[3], "\t", fields[4], "\t", fields[5] 
     25        print fields[0], time.strftime("%H:%M:%S", time.gmtime(t)), 
     26        print ("  %4s"% (fields[2])),  
     27        print " ", fields[3], " ", (" %5s"%(fields[4])), "\t", fields[5] 
     28    else: 
     29        print str 
    2330 
    2431    # read a line and output with :30 secs 
    2532    str = raw_input(""); 
    26     t = (2009, 2, 17, 0, mincount, 30, 1, 0, 0) 
    27     t = time.mktime(t) 
    28     print time.strftime("%H:%M:%S", time.gmtime(t)), str 
     33    if str[0] != '#': 
     34        fields = str.split() 
     35        t = (2009, 2, 17, 0, mincount, 30, 1, 0, 0) 
     36        t = time.mktime(t) 
     37        print fields[0], time.strftime("%H:%M:%S", time.gmtime(t)), 
     38        print ("  %4s"% (fields[2])),  
     39        print " ", fields[3], " ", (" %5s"%(fields[4])), "\t", fields[5] 
     40    else: 
     41        print str 
     42 
    2943    # increment the minute 
    3044    mincount += 1; 
Note: See TracChangeset for help on using the changeset viewer.