- for srcname in toimport :
- if srcname == 'killall':
- clt.showNS()
- killAllPorts()
- sys.exit(0)
- else:
- if os.path.isabs(srcname):
- if os.path.exists(srcname):
- execScript(srcname)
- elif os.path.exists(srcname+".py"):
- execScript(srcname+".py")
- else:
- print "Can't execute file %s" % srcname
- pass
- else:
- found = False
- for path in [os.getcwd()] + sys.path:
- if os.path.exists(os.path.join(path,srcname)):
- execScript(os.path.join(path,srcname))
- found = True
- break
- elif os.path.exists(os.path.join(path,srcname+".py")):
- execScript(os.path.join(path,srcname+".py"))
- found = True
- break
- pass
- if not found:
- print "Can't execute file %s" % srcname
- pass
- pass
- pass
- pass
- pass