From cfba04ce207fbc5fa768b32ef6e59061978ff129 Mon Sep 17 00:00:00 2001 From: dmarakom6 Date: Fri, 2 Jul 2021 11:41:52 +0300 Subject: [PATCH] Update m.py --- util/notegrep/m.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/util/notegrep/m.py b/util/notegrep/m.py index 0b6e280..1abc210 100644 --- a/util/notegrep/m.py +++ b/util/notegrep/m.py @@ -6,22 +6,22 @@ class Multi(): self.patterns = patterns self.files = files - def print_matches(self, patterns, files): + def print_matches(self): error = "Invalid input.\nExample: shellnotes -m pattern1,pattern2,pattern3 file1,file2,file3" - for pattern in patterns: + for pattern in self.patterns: if pattern == "": return error print(pattern, end=", ") print() - for file in files: + for file in self.files: if file == "": return error print(file, end=", ") try: newMulti = Multi(sys.argv[1].split(','), sys.argv[2].split(',')) - newMulti.print_matches(sys.argv[1].split(','), sys.argv[2].split(',')) + newMulti.print_matches() except IndexError: patterns = input("Enter patterns, separated by a comma: ") files = input("Enter files, separated by a comma: ") newMulti = Multi(patterns.split(','), files.split(',')) - newMulti.print_matches(patterns.split(','), files.split(',')) + newMulti.print_matches() \ No newline at end of file