remake_servants.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 import sys
00004 import os
00005 
00006 def destroy_and_make(dirname):
00007   print "remake : dirname : ", dirname
00008 
00009   try:
00010 #    os.rmdir(os.path.abspath(dirname))
00011     os.rename(dirname, dirname + '_')
00012   except:
00013     print "Directory \"" + dirname + "\" not found."
00014 
00015 
00016   try:
00017     os.system("./setuptest.py " + dirname + " ")
00018   except:
00019     print "Directory \"" + dirname + "\" already exists."
00020 
00021 
00022 
00023 
00024 dirname = sys.argv[1]
00025 #print  os.path.abspath(dirname)
00026 
00027 if dirname != 'all':
00028   print "Usage : " + sys.argv[0] + " all";
00029   exit(1)
00030 
00031 for pwd, dirs, files in os.walk('.'):
00032 #  print "dirs : ", dirs
00033   break
00034 
00035 for d in dirs:
00036   if d.rfind("Servant") > 0:
00037     print d, d.rfind("Servant")
00038     destroy_and_make(d)
00039 
00040 
00041 #destroy_and_make(dirname)
00042 
00043 exit(0)
00044 


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Sat Jun 8 2019 18:49:06