def run(self):
start = time.time()
for entry in os.scandir(self.folder):
if entry.is_file():
if self.case_sensitive:
path = entry.path
else:
path = entry.path.lower()
if self.search_term in path:
_, ext = os.path.splitext(entry.path)
-> if self.file_type and self.file_type == ext.lower():
-> data = (entry.path, entry.stat().st_mtime)
-> wx.CallAfter(pub.sendMessage,
-> 'update', result=data)
-> else:
-> data = (entry.path, entry.stat().st_mtime)
-> wx.CallAfter(pub.sendMessage,
-> 'update', result=data)
end = time.time()
wx.CallAfter(pub.sendMessage, 'status', search_time=end-start)'
and I'm wondering what the purpose of the if/else statement serves. It appears that the same code is called regardless of whether the if or the else branch is executed.
I'm pretty sure there was a difference while I was developing it and then as it got abstracted, the differences went away without me noticing. Sorry about that. I just removed the duped code and submitted it.
I'm seeing the following code:
and I'm wondering what the purpose of the if/else statement serves. It appears that the same code is called regardless of whether the if or the else branch is executed.