def find_delete_file(ndir, buff_dir, type_file): con = sqlConnection.connect() set_ndir = set(ndir) set_buff_dir = set(buff_dir) res = set_ndir.difference(set_buff_dir) sqlConnection.delete(con, str(res), type_file) con.close() print(str(res) + ' <- delete')
def find_rename_file(ndir, buff_dir, type_file): con = sqlConnection.connect() set_ndir = set(ndir) set_buff_dir = set(buff_dir) old_name = set_ndir.difference(set_buff_dir) new_name = set_buff_dir.difference(set_ndir) sqlConnection.rename(con, str(old_name), str(new_name), type_file) con.close() print(str(old_name) + ' -> rename -> ' + str(new_name))
def find_new_file(ndir, buff_dir, type_file): coast = 0 if type_file == 'key': coast = 5 elif type_file == 'account': coast = 10 elif type_file == 'socks': coast = 15 con = sqlConnection.connect() set_ndir = set(ndir) set_buff_dir = set(buff_dir) res = set_buff_dir.difference(set_ndir) print(str(res)) sqlConnection.insert(con, str(res), type_file, coast) con.close() print(str(res) + ' <- added')