File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33import bisect
44import os
55import re
6+ import sys
67from functools import cmp_to_key
78
89
@@ -155,10 +156,10 @@ def key_func(x):
155156 def display_sorted (self ):
156157 """Displays the current sorted data."""
157158 output_stream = sys .stderr if self .args .stderr else sys .stdout
158-
159+
159160 if not self .args .stderr :
160- os .system (' cls' if os .name == 'nt' else ' clear' )
161-
161+ os .system (" cls" if os .name == "nt" else " clear" )
162+
162163 print ("--- Interactive Sorted Data ---" , file = output_stream )
163164 items_to_display = self .data
164165 if self .args .unique :
@@ -176,7 +177,9 @@ def output_final_sorted(self):
176177 """Outputs the final sorted data to stdout (used when stderr flag is set)."""
177178 items_to_display = self .data
178179 if self .args .unique :
179- items_to_display = sorted (list (set (items_to_display )), key = lambda x : self .data .index (x )) # Maintain original order of first occurrence
180+ items_to_display = sorted (
181+ set (items_to_display ), key = lambda x : self .data .index (x )
182+ ) # Maintain original order of first occurrence
180183 if self .args .reverse :
181184 items_to_display = reversed (items_to_display )
182185
You can’t perform that action at this time.
0 commit comments