Skip to content

Commit 765e293

Browse files
disable palette, min python version 3.9
1 parent 6c9bac1 commit 765e293

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

AwkExercises/awk_exercises.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
SCRIPT_DIR = Path(__file__).parent.resolve()
1414

1515
class AwkExercisesApp(App):
16+
ENABLE_COMMAND_PALETTE = False
1617
CSS_PATH = SCRIPT_DIR.joinpath('awk_exercises.css')
1718
BINDINGS = [
1819
Binding('ctrl+s', 'show_solution', 'Solution', show=True),
@@ -172,9 +173,7 @@ def set_cmd(self, cmd):
172173
self.process_user_cmd()
173174

174175
def trim(self, text):
175-
if text.endswith('\n'):
176-
text = text[:-1]
177-
return text
176+
return text.removesuffix('\n')
178177

179178
def save_progress(self):
180179
cmd = self.i_cmd.value

AwkTutorial/awk_tutorial.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
SCRIPT_DIR = Path(__file__).parent.resolve()
1212

1313
class AwkTutorialApp(App):
14+
ENABLE_COMMAND_PALETTE = False
1415
CSS_PATH = SCRIPT_DIR.joinpath('awk_tutorial.css')
1516
BINDINGS = [
1617
Binding('ctrl+p', 'previous', 'Previous', show=True),
@@ -115,9 +116,7 @@ def set_cmd(self, cmd):
115116
self.process_user_cmd()
116117

117118
def trim(self, text):
118-
if text.endswith('\n'):
119-
text = text[:-1]
120-
return text
119+
return text.removesuffix('\n')
121120

122121
def l_cmd_output_style(self, color, title, subtitle):
123122
self.l_cmd_output.styles.color = color

GrepExercises/grep_exercises.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
SCRIPT_DIR = Path(__file__).parent.resolve()
1414

1515
class GrepExercisesApp(App):
16+
ENABLE_COMMAND_PALETTE = False
1617
CSS_PATH = SCRIPT_DIR.joinpath('grep_exercises.css')
1718
BINDINGS = [
1819
Binding('ctrl+s', 'show_solution', 'Solution', show=True),
@@ -186,9 +187,7 @@ def set_cmd(self, cmd):
186187
self.process_user_cmd()
187188

188189
def trim(self, text):
189-
if text.endswith('\n'):
190-
text = text[:-1]
191-
return text
190+
return text.removesuffix('\n')
192191

193192
def save_progress(self):
194193
cmd = self.i_cmd.value

SedExercises/sed_exercises.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
SCRIPT_DIR = Path(__file__).parent.resolve()
1414

1515
class SedExercisesApp(App):
16+
ENABLE_COMMAND_PALETTE = False
1617
CSS_PATH = SCRIPT_DIR.joinpath('sed_exercises.css')
1718
BINDINGS = [
1819
Binding('ctrl+s', 'show_solution', 'Solution', show=True),
@@ -172,9 +173,7 @@ def set_cmd(self, cmd):
172173
self.process_user_cmd()
173174

174175
def trim(self, text):
175-
if text.endswith('\n'):
176-
text = text[:-1]
177-
return text
176+
return text.removesuffix('\n')
178177

179178
def save_progress(self):
180179
cmd = self.i_cmd.value

0 commit comments

Comments
 (0)