canfestival/config_utils.py
changeset 1834 cd42b426028b
parent 1831 56b48961cc68
child 1847 6198190bc121
equal deleted inserted replaced
1833:2269739dd098 1834:cd42b426028b
    22 # along with this program; if not, write to the Free Software
    22 # along with this program; if not, write to the Free Software
    23 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    23 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    24 
    24 
    25 
    25 
    26 from __future__ import print_function
    26 from __future__ import print_function
       
    27 import os
       
    28 import sys
       
    29 import getopt
    27 from types import *
    30 from types import *
    28 
    31 
    29 # Translation between IEC types and Can Open types
    32 # Translation between IEC types and Can Open types
    30 IECToCOType = {
    33 IECToCOType = {
    31     "BOOL":    0x01,
    34     "BOOL":    0x01,
   692             pointers[(index, subindex)] = name
   695             pointers[(index, subindex)] = name
   693     return pointers
   696     return pointers
   694 
   697 
   695 
   698 
   696 if __name__ == "__main__":
   699 if __name__ == "__main__":
   697     import os
       
   698     import sys
       
   699     import getopt
       
   700 
       
   701     def usage():
   700     def usage():
   702         print("""
   701         print("""
   703 Usage of config_utils.py test :
   702 Usage of config_utils.py test :
   704 
   703 
   705     %s [options]
   704     %s [options]
   782         testfile.write(result)
   781         testfile.write(result)
   783         testfile.close()
   782         testfile.close()
   784 
   783 
   785         print("Reset Successful!")
   784         print("Reset Successful!")
   786     else:
   785     else:
   787         import os
       
   788 
       
   789         testfile = open("test_config/result_tmp.txt", "w")
   786         testfile = open("test_config/result_tmp.txt", "w")
   790         testfile.write(result)
   787         testfile.write(result)
   791         testfile.close()
   788         testfile.close()
   792 
   789 
   793         os.system("diff test_config/result.txt test_config/result_tmp.txt")
   790         os.system("diff test_config/result.txt test_config/result_tmp.txt")