예제 #1
0
        print 'Unknown option %s' %(Uoptions[1])
        sys.exit(helpInfo)
    else:
        pattern='non-verbose'
        projName = Uoptions[1]             
elif len(Uoptions)==3:
    if Uoptions[1]!='-q':
        sys.exit(helpInfo)
    else:
        pattern='verbose'
        projName = Uoptions[2]
while (not projName):
    projName = raw_input("Project Name: ")

try:
    projPathInfo=pathInfo(projName)
except:
    sys.exit()
   
# pathInfo: pathOutput=(pathAbs,projName,projNameA,projNameP,projNameAP,pathPrefix,secId,pidType,localPathPrefix,projPathAtLocal)
#                          0       1         2        3         4           5         6    7            8             9
#                                                                                                      -2            -1
print "\nYou are going to initialize a project with the following parameters:"
print "           Section : %s" %(projPathInfo[6])
print "      Project Type : %s" %(projPathInfo[7])
print "Local Project Path : %s\n" %(projPathInfo[9])
pathVerify=raw_input("Is the above information correct [y] (y/n) ? " )
pathVerify=pathVerify.upper()
#print pathVerify
while not (pathVerify in ["","Y","N","YES","NO"]):
    print "Please answer with \"y\" or \"n\" "
예제 #2
0
                    sponsorUnjoined='yes'
        XMLLink_old=os.path.join(projRoot0,'Projects/.projInfo',projInfoFileName_old.replace('/','=>'))
        (projNum)[0].firstChild.nodeValue= projNum[0].firstChild.nodeValue.replace(projName_old,projName_new)
        projInfoFileName_new=(projNum)[0].firstChild.nodeValue.replace(projName_old,projName_new).strip() 
        XMLLink_new=os.path.join(projRoot0,'Projects/.projInfo',projInfoFileName_new.replace('/','=>'))

except:
    print "Please try again with correct project Information."
    sys.exit()
memberList=[]
for tuplelist in currentMemberInfo:
    memberList.append(tuplelist[0])
if os.environ['USER'] in memberList:
    if oldisproj=='yes' and newisproj=='no':   # sponsor? then do extra:
        if iscurrenmember==0:
            projPathInfo_new=pathInfo(newPathCheck[0])
            pathAbs_new=projPathInfo_new[0]
            pathPrefix_new=projPathInfo_new[5]
            projName_new=projPathInfo_new[1]
            secId_new=projPathInfo_new[6]
            pidType_new=projPathInfo_new[7]
            projNameP_new=projPathInfo_new[3]
            localPrefix_new=projPathInfo_new[8]
            projPathAtLocal_new=projPathInfo_new[9]
            projPathAtRemoteAP_new=projPathInfo_new[4]
            file = open(pathToXML, 'w')
            file.write(xmldoc.toxml())
            file.close()           
else:
    sys.exit("You are not member of the project.")