Exemplo n.º 1
0
def dingdong():
    print("shalalalallala")
    importlib.reload(vari)
    uid = vari.userId
    val = ConnectionToNeo4j.checkuserinnwadas(uid)
    result = {"myca": str(val)}
    return json.dumps(result)
Exemplo n.º 2
0
def get_post_cv_javascript_data():
    print("hello ")

    fname = str(request.form['flname'])
    usage = str(request.form['uage'])
    usschool = str(request.form['uschool'])
    usuni = str(request.form['uuni'])
    usdob = str(request.form['udob'])
    usemail = str(request.form['uemail'])
    ustpno = str(request.form['utpno'])
    usweak = str(request.form['uweak'])
    usstrengh = str(request.form['ustrength'])
    usidlcmp = str(request.form['uidcomp'])
    usftech = str(request.form['ufmtech'])
    usproone = str(request.form['uproone'])
    ustech1 = str(request.form['utech1'])
    usprotwo = str(request.form['uprotwo'])
    ustech2 = str(request.form['utech2'])

    techsAvailable = []
    infoRetList = []
    finalFamiliarTechList = []
    techWord_list = usftech.split(',')
    for techWord in techWord_list:
        techWord = techWord.lower()
        availability_node = ConnectionToNeo4j.getMatchingTopicsNonTech1(techWord)
        print(techWord)
        print(availability_node)
        if availability_node == True:
            print("available")
            techsAvailable.append(techWord)
            print(techsAvailable)
        elif availability_node == False:
            print("not available")
            if techWord == "c#":
                techWord = "csharp"
            elif techWord == "c++":
                techWord = "cplusplus"
            elif techWord == "c":
                techWord = "cprogramming"

            infoList = inforetrievel.inforetrievel(techWord)
            infoRet = infoList[0]
            print("returning ")
            print(infoRet)
            print("returning ")

            technicalNodeCnt = infoList[1]
            print("returning node count ")
            print(technicalNodeCnt)
            print("returning node count ")

            if infoRet != "0":
                infoRet = infoRet.lower()
                print(infoRetList)
                infoRetList.append(infoRet)
                print(infoRetList)
                # ##########################################3 new

                nodeCountValue = int(technicalNodeCnt / 3)
                print(nodeCountValue)
                changingNodeCountValue = nodeCountValue
                remainingValue = technicalNodeCnt - (nodeCountValue * 3)
                print(remainingValue)
                easyNodes = ""
                mediumNodes = ""
                hardNodes = ""

                exactCount = technicalNodeCnt

                while changingNodeCountValue > 0:
                    easyNodes = easyNodes + "," + str(exactCount)
                    exactCount = exactCount - 1
                    changingNodeCountValue = changingNodeCountValue - 1
                print(easyNodes)
                easyNodes = easyNodes[1:]
                print(easyNodes)

                changingNodeCountValue = nodeCountValue

                print("nooooooooooooooooooooooooooooooo")
                while changingNodeCountValue > 0:
                    mediumNodes = mediumNodes + "," + str(exactCount)
                    exactCount = exactCount - 1
                    changingNodeCountValue = changingNodeCountValue - 1
                print(mediumNodes)
                mediumNodes = mediumNodes[1:]
                print(mediumNodes)

                print("nooooooooooooooooooooooooooooooo")

                changingNodeCountValue = nodeCountValue + remainingValue
                print(changingNodeCountValue)
                while changingNodeCountValue > 0:
                    hardNodes = hardNodes + "," + str(exactCount)
                    exactCount = exactCount - 1
                    changingNodeCountValue = changingNodeCountValue - 1
                print(hardNodes)
                hardNodes = hardNodes[1:]
                print(hardNodes)

                restResult = ConnectionToNeo4j.addDifficultyLevelsForSpecificTech(infoRet, easyNodes, mediumNodes,hardNodes)

                # ########################################## new

    importlib.reload(infowhat)
    open('Controller/infowhat.py', 'w').close()
    fruits = ["global valusa\n", "valusa = 'fn'\n"]
    new_file = open("Controller/infowhat.py", mode="a+", encoding="utf-8")
    new_file.writelines(fruits)
    for line in new_file:
        print(line)




    finalFamiliarTechList = techsAvailable +infoRetList
    print(finalFamiliarTechList)
    finalFamiliarTech = ','.join(finalFamiliarTechList)
    print(finalFamiliarTech)
    # while finalFamiliarTechList[0] == ',':
    #     print("in")
    #     finalFamiliarTechList = finalFamiliarTechList[1:]
    #     print(finalFamiliarTechList)
    # stringLength = len(finalFamiliarTechList) - 1
    # while finalFamiliarTechList[stringLength] == ',':
    #     print("hahaa")
    #     finalFamiliarTechList = finalFamiliarTechList[:stringLength]
    # print(finalFamiliarTechList)

    importlib.reload(vari)
    uid = vari.userId

    validation = ConnectionToNeo4j.checkuserinnwadas(uid)

    if validation != True:
        fresult = ConnectionToNeo4j.createNewCv(uid,fname,usage,usschool,usuni,usdob,usemail,ustpno,usweak,usstrengh,usidlcmp,finalFamiliarTech,usproone,ustech1,usprotwo,ustech2)

    print(fname)
    pythondata = {'val':'jaja'}
    return json.dumps(pythondata)