Skip to content

Commit

Permalink
printing from the compare data func.
Browse files Browse the repository at this point in the history
  • Loading branch information
subhrapaladhi committed Oct 24, 2020
1 parent df2c171 commit 4f74296
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 21 deletions.
Binary file modified __pycache__/fileDataChecker.cpython-38.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion data.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Mt search engws, dfgardless of if they trackdcrypt your searcdata. This is how search engines, including Google, Yahoo and Sea32rch Encrypt, all protect th45r users’ information. Google, which collects tons of user data, is obligated to protect that information. SSL encryption is a standard for protecting sensitive information, for search engines and other websites.
this is test ok
18 changes: 4 additions & 14 deletions dataCheckerUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,10 @@ def dataCheck(self):
self.fileDataChecker.readFileData()
self.fileDataChecker.getHasherData()
self.fileDataChecker.hasher()
self.comparedResult = self.fileDataChecker.compareData()

if(self.comparedResult == ""):
T = Text(self.root,height=25,width=98)
T.pack()
T.place(x=5,y=90)
T.insert(END,"The data in the two files are same")
print("The data in the two files are same")
else:
T = Text(self.root,height=25,width=98)
T.pack()
T.place(x=5,y=90)
T.insert(END,self.comparedResult)
print(self.comparedResult)
T = Text(self.root,height=25,width=98)
T.pack()
T.place(x=5,y=90)
self.fileDataChecker.compareData(T)


dataCheckerUI = DataCheckerUI()
Expand Down
20 changes: 14 additions & 6 deletions fileDataChecker.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import hashlib
from pymongo import MongoClient
from tkinter import *
from tkinter import filedialog

class FileDataChecker:
def __init__(self,filename,key):
Expand Down Expand Up @@ -39,13 +41,17 @@ def hasher(self):
print(substr)
# print(result)

def compareData(self):
def compareData(self,T):
oriLen = len(self.hashArray)
modLen = len(self.editedFileHashArray)
print("orilen = {} || modlen = {}".format(oriLen,modLen))
comparedResult = ""
if(oriLen == modLen):
i = 0

if(self.hashArray[0] == self.editedFileHashArray[0]):
comparedResult = self.hashArray[0]

i = 1
while(i<oriLen):
if(self.hashArray[i] != self.editedFileHashArray[i]):
origData = self.unhashedDataArray[i]
Expand Down Expand Up @@ -91,10 +97,12 @@ def compareData(self):
leftData += temp[-1]
i+=1
comparedResult += "This data is not there in the edited data: {}".format(leftData)
# print("This data is not there in the original data: {}".format(leftData))
# print(comparedResult)
return comparedResult
# 81e37fa4f8dd
print("This data is not there in the original data: {}".format(leftData))
print(comparedResult)
# return comparedResult
T.insert(END,comparedResult)



# fileDataChecker = FileDataChecker("./data.txt","a5e099824b50")
# fileDataChecker.readFileData()
Expand Down

0 comments on commit 4f74296

Please sign in to comment.