Beispiel #1
0
 def save_data(name, description, filename, filerow):
     mc = mysql_connect.cursor()
     query = "INSERT INTO bot_task_template_file (name, description, file_name, file_row) VALUES (%s,%s,%s,%s)"
     data = (name, description, filename, filerow)
     mc.execute(query, (data))
     mysql_connect.commit()
     result = mc.fetchall()
     return result
Beispiel #2
0
 def update_log(log, task):
     mc = mysql_connect.cursor()
     now = datetime.now()
     query = "INSERT INTO log (log_description, bot_task_group_id, log_start_date_time, log_end_date_time, created_at ) VALUES (%s,%s,%s,%s,%s)"
     data = (log, task, now, now, now)
     mc.execute(query, (data))
     mysql_connect.commit()
     result = mc.fetchall()
     return result
Beispiel #3
0
 def import_data(file_path):
     mc = mysql_connect.cursor()
     csv_data = csv.reader(open(file_path))
     next(csv_data)
     now = datetime.now()
     for row in csv_data:
         mc.execute('INSERT INTO task_value(task_value_name, task_value_category ,created_at) VALUES (%s, %s, %s)' , (row[0],row[1],now)  )
     mysql_connect.commit()
     mc.close()
 def save_data(name, sn_range, group_name, last_sn):
     mc = mysql_connect.cursor()
     now = datetime.now()
     query = "INSERT INTO bot_task_template (bot_task_template_name, sn_range, bot_user_group_name, cloned_create_bot_task_groups ,created_at ) VALUES (%s,%s,%s,%s,%s)"
     data = (name, sn_range, group_name, last_sn, now)
     mc.execute(query, (data))
     mysql_connect.commit()
     result = mc.fetchall()
     return result
 def save_bot_task(name, checkId, sn):
     mc = mysql_connect.cursor()
     now = datetime.now()
     query = "INSERT INTO bot_task (bot_task_name, bot_task_template_id, SN, created_at ) VALUES (%s,%s,%s,%s)"
     data = (name, checkId, sn, now)
     mc.execute(query, (data))
     mysql_connect.commit()
     result = mc.fetchall()
     return result
 def save_data(name, description):
     mc = mysql_connect.cursor()
     now = datetime.now()
     query = "INSERT INTO bot_user_group (bot_user_group_name, created_at ) VALUES (%s,%s)"
     data = (name, now)
     mc.execute(query, (data))
     mysql_connect.commit()
     result = mc.fetchall()
     return result
Beispiel #7
0
 def update_data(c1, c2):
     mc = mysql_connect.cursor()
     query = "UPDATE bot_task SET run_count = %s WHERE bot_task_id = %s"
     data = (c1,c2)
     mc.execute(query,(data))
     mysql_connect.commit()
     result = mc.fetchall()
     print("Record Updated successfully ")
     return result        
 def save_data(kategori,name,description):
     mc = mysql_connect.cursor()
     now = datetime.now()
     query = "INSERT INTO scene (scene_category_id, scene_name, created_at ) VALUES (%s,%s,%s)"
     data = (kategori,name,now)
     mc.execute(query,(data) )
     mysql_connect.commit()
     result = mc.fetchall()
     return result        
    def import_data(file_path):
        mc = mysql_connect.cursor()
        csv_data = csv.reader(open(file_path))
        next(csv_data)
        # today = date.today()
        now = datetime.now()

        for row in csv_data:
            mc.execute('INSERT INTO bot_user(bot_user_name,created_at) VALUES (%s, %s)', (row, now))
        mysql_connect.commit()
        mc.close()
Beispiel #10
0
    def import_data(file_path):
        mc = mysql_connect.cursor()
        csv_data = csv.reader(open(file_path))
        next(csv_data)
        now = datetime.now()
        for row in csv_data:
            id2 = int(row[2])
            id4 = int(row[4])
            id6 = int(row[6])

            mc.execute(
                'INSERT INTO task_function(task_function_name, task_function_content , task_function_category_id , task_function_category, task_value_group_id ,task_value_group, created_at) VALUES (%s, %s, %s, %s, %s, %s, %s)',
                (row[0], row[1], id2, row[3], id4, row[5], id6, now))
        mysql_connect.commit()
        mc.close()