Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def append_log(line: dict, file: string):
- logfile = open(file, 'a+')
- print>>logfile, line
- logfile.close()
- return
- def compare_line(line: dict, file: string):
- file = open(file, 'r+')
- contents = logfile.readlines()
- logfile.close()
- # Check log files for duplicates
- for row in contents:
- test = cmp(line, row)
- if test == 0:
- # return None if a match is found
- return None
- # No duplicate found
- return True
- # Check if the log file contains the transaction
- # by compare_line(dict, logfile). If it returns true,
- # add the line to log file append_log(dict, logfile)
- # and then push line to Fiken. If false, skip the line.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement