mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 13:31:32 +00:00
Start working on something better than == for history checks
This commit is contained in:
parent
088a1cefc5
commit
7572699e55
19
lib/tfw/components/commands_equal.py
Normal file
19
lib/tfw/components/commands_equal.py
Normal 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)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user