Start working on something better than == for history checks

This commit is contained in:
Kristóf Tóth 2018-08-03 13:40:34 +02:00
parent 088a1cefc5
commit 7572699e55

View File

@ -0,0 +1,19 @@
# Copyright (C) 2018 Avatao.com Innovative Learning Kft.
# All Rights Reserved. See LICENSE file for details.
from shlex import split
class CommandsEqual:
def __init__(self, command_1, command_2):
self.command_1 = command_1
self.command_2 = command_2
def __bool__(self):
parts_1 = split(self.command_1)
parts_2 = split(self.command_2)
return (
parts_1[0] == parts_2[0]
and set(parts_1) == set(parts_2)
)