25 if len(sys.argv) != 2:
27 print sys.argv[0],
" *.py " 31 fullname = sys.argv[1]
33 dirname = os.path.dirname(sys.argv[1])
35 sys.path.append(dirname)
38 basename = os.path.basename(sys.argv[1])
40 classname = basename.split(
".")[0].lower()
45 opts.append(
"manager.modules.load_path: " + dirname)
47 opts.append(
"logger.enable:NO")
49 opts.append(
"manager.corba_servant:NO")
52 OpenRTM_aist.Manager.init(opts)
53 mgr = OpenRTM_aist.Manager.instance()
57 oldp = mgr.getFactoryProfiles()
60 comp_spec_name = classname+
"_spec" 63 imp_file = __import__(basename.split(
".")[0])
68 comp_spec = getattr(imp_file,comp_spec_name,
None)
78 for i
in range(len(oldp)):
79 if oldp[i].getProperty(
"implementation_id") == newp.getProperty(
"implementation_id")
and \
80 oldp[i].getProperty(
"type_name") == newp.getProperty(
"type_name")
and \
81 oldp[i].getProperty(
"description") == newp.getProperty(
"description")
and \
82 oldp[i].getProperty(
"version") == newp.getProperty(
"version"):
90 print "Load failed. file name: ", fname
95 print "One or more modules loaded." 99 keys = profs[0].propertyNames()
101 print "%s:%s"%(key,profs[0].getProperty(key))
106 if __name__ ==
"__main__":
The Properties class represents a persistent set of properties.