Esempio n. 1
0
 def createNewJob(self, contentName, contentID, keyword, content):
     con = None
     try:
         con = psycopg2.connect(database='d1s3idai1l2u3d', user='******', password='******', host='ec2-54-197-241-24.compute-1.amazonaws.com', port='5432', sslmode='require')
         cur = con.cursor()
     except psycopg2.DatabaseError as e:
         print ('Error %s' % e)
         sys.exit(1)
     finally:
         if con:
             cur.execute("SELECT * FROM resume");
             rows = cur.fetchall()
             numRows = (len(rows))
             newJob = JobDescNode(contentID, keyword, content)
             if (numRows == 0):
                 ResumeProcessor.construct(newJob)
                 toPrint = encodeClassToJson(newJob)
                 cur.execute("INSERT INTO job VALUES (%s,%s,%s,%s)",(toPrint,'f', contentID ,contentName))
                 con.commit()
             else:
                 ResumeProcessor.construct(newJob)
                 toPrint = encodeClassToJson(newJob)
                 cur.execute("INSERT INTO job VALUES (%s,%s,%s,%s)",(toPrint,'f', contentID ,contentName))
                 con.commit()
                 f = Facade()
                 matcher = Matcher(f)
                 scorer = Scorer(f)
                 matcher.matchAll(2)
                 scorer.calculateScore()
             con.close()
Esempio n. 2
0
    def createNewResume(self, name, hpNumber, email, contentName, content):
        con = None
        try:
            con = psycopg2.connect(
                database='d1s3idai1l2u3d',
                user='******',
                password='******',
                host='ec2-54-197-241-24.compute-1.amazonaws.com',
                port='5432',
                sslmode='require')
            cur = con.cursor()
        except psycopg2.DatabaseError as e:
            print('Error %s' % e)
            sys.exit(1)
        finally:
            if con:
                cur.execute("SELECT * FROM job")
                rows = cur.fetchall()
                numRows = (len(rows))
                newResume = ResumeNode(name, hpNumber, email, contentName,
                                       content)

                if (numRows == 0):
                    ResumeProcessor.construct(newResume)
                    toPrint = encodeClassToJson(newResume)
                    cur.execute(
                        "INSERT INTO resume VALUES (%s,%s,%s,%s,%s,%s)",
                        (toPrint, 'f', contentName, name, hpNumber, email))
                    con.commit()
                else:
                    ResumeProcessor.construct(newResume)
                    toPrint = encodeClassToJson(newResume)
                    cur.execute(
                        "INSERT INTO resume VALUES (%s,%s,%s,%s,%s,%s)",
                        (toPrint, 'f', contentName, name, hpNumber, email))
                    con.commit()
                    f = Facade()
                    matcher = Matcher(f)
                    scorer = Scorer(f)
                    matcher.matchAll(1)
                    scorer.calculateScore()
                con.close()
Esempio n. 3
0
 def storeMatchBoxes(self,mboxes):
     con = None
     try:
         con = psycopg2.connect(database='d1s3idai1l2u3d', user='******', password='******', host='ec2-54-197-241-24.compute-1.amazonaws.com', port='5432', sslmode='require')
         cur = con.cursor()
     except psycopg2.DatabaseError as e:
         print ('Error %s' % e)
         sys.exit(1)
     finally:
         for xx in mboxes:
             toPrintTwo = encodeClassToJson(xx)
             cur.execute("INSERT INTO matchbox VALUES (%s)",(toPrintTwo,))
             con.commit()
         con.close()
Esempio n. 4
0
 def storeMatchBoxes(self, mboxes):
     con = None
     try:
         con = psycopg2.connect(
             database='d1s3idai1l2u3d',
             user='******',
             password='******',
             host='ec2-54-197-241-24.compute-1.amazonaws.com',
             port='5432',
             sslmode='require')
         cur = con.cursor()
     except psycopg2.DatabaseError as e:
         print('Error %s' % e)
         sys.exit(1)
     finally:
         for xx in mboxes:
             toPrintTwo = encodeClassToJson(xx)
             cur.execute("INSERT INTO matchbox VALUES (%s)", (toPrintTwo, ))
             con.commit()
         con.close()
Esempio n. 5
0
 def addMatchBoxes(self, mboxes):
     con = None
     try:
         con = psycopg2.connect(
             database="d1s3idai1l2u3d",
             user="******",
             password="******",
             host="ec2-54-197-241-24.compute-1.amazonaws.com",
             port="5432",
             sslmode="require",
         )
         cur = con.cursor()
     except psycopg2.DatabaseError as e:
         print("Error %s" % e)
         sys.exit(1)
     finally:
         for xx in mboxes:
             toPrintTwo = encodeClassToJson(xx)
             cur.execute("INSERT INTO matchbox VALUES (%s)", (toPrintTwo,))
             con.commit()
         con.close()
Esempio n. 6
0
con = None
try:
    con = psycopg2.connect(database='d1s3idai1l2u3d', user='******', password='******', host='ec2-54-197-241-24.compute-1.amazonaws.com', port='5432', sslmode='require')
    cur = con.cursor()
except psycopg2.DatabaseError as e:
    print ('Error %s' % e)
    sys.exit(1)
finally:
    if con:
        cur.execute("SELECT * FROM resume");
        rows = cur.fetchall()
        numRows = (len(rows))
        newJob = JobDescNode(contentID, contentFile, keyword)
        if (numRows == 0):
            ResumeProcessor.construct(newJob)
            toPrint = encodeClassToJson(newJob)
            cur.execute("INSERT INTO job VALUES (%s,%s,%s,%s)",(toPrint,'f', contentID ,contentName))
            con.commit()
            print('just store job')
        else:
            ResumeProcessor.construct(newJob)
            toPrint = encodeClassToJson(newJob)
            cur.execute("INSERT INTO job VALUES (%s,%s,%s,%s)",(toPrint,'f', contentID ,contentName))
            con.commit()
            f = Facade()
            matcher = Matcher(f)
            scorer = Scorer(f)
            cur.execute("SELECT isonce_resume FROM once")
            rows = cur.fetchall()
            for row in rows:
                if(row[0] is True):
Esempio n. 7
0
con = None
try:
        con = psycopg2.connect(database='d1s3idai1l2u3d', user='******', password='******', host='ec2-54-197-241-24.compute-1.amazonaws.com', port='5432', sslmode='require')
        cur = con.cursor()
except psycopg2.DatabaseError as e:
        print ('Error %s' % e)
        sys.exit(1)
finally:
        if con:
            cur.execute("SELECT * FROM job");
            rows = cur.fetchall()
            numRows = (len(rows))

            if (numRows == 0):
                ResumeProcessor.construct(newResume)
                toPrint = encodeClassToJson(newResume)
                #print(type(newResume.getContent()))
                print(toPrint)
                cur.execute("INSERT INTO resume VALUES (%s,%s,%s,%s,%s,%s)",(toPrint,'f',contentName,name,hpNumber,email))
                con.commit()
            else:
                ResumeProcessor.construct(newResume)
                toPrint = encodeClassToJson(newResume)
                #print(type(newResume.getContent()))
                print(toPrint)
                cur.execute("INSERT INTO resume VALUES (%s,%s,%s,%s,%s,%s)",(toPrint,'f',contentName,name,hpNumber,email))
                con.commit()
                f = Facade()
                matcher = Matcher(f)
                scorer = Scorer(f)
                cur.execute("SELECT isonce_resume FROM once")
Esempio n. 8
0
                           host='ec2-54-197-241-24.compute-1.amazonaws.com',
                           port='5432',
                           sslmode='require')
    cur = con.cursor()
except psycopg2.DatabaseError as e:
    print('Error %s' % e)
    sys.exit(1)
finally:
    if con:
        cur.execute("SELECT * FROM job")
        rows = cur.fetchall()
        numRows = (len(rows))

        if (numRows == 0):
            ResumeProcessor.construct(newResume)
            toPrint = encodeClassToJson(newResume)
            #print(type(newResume.getContent()))
            print(toPrint)
            cur.execute("INSERT INTO resume VALUES (%s,%s,%s,%s,%s,%s)",
                        (toPrint, 'f', contentName, name, hpNumber, email))
            con.commit()
        else:
            ResumeProcessor.construct(newResume)
            toPrint = encodeClassToJson(newResume)
            #print(type(newResume.getContent()))
            print(toPrint)
            cur.execute("INSERT INTO resume VALUES (%s,%s,%s,%s,%s,%s)",
                        (toPrint, 'f', contentName, name, hpNumber, email))
            con.commit()
            f = Facade()
            matcher = Matcher(f)