File tree Expand file tree Collapse file tree 1 file changed +3
-18
lines changed Expand file tree Collapse file tree 1 file changed +3
-18
lines changed Original file line number Diff line number Diff line change @@ -184,21 +184,6 @@ def do_init(self):
184
184
def exit (self ):
185
185
pass
186
186
187
- @log .log_function ()
188
- def lchop (self , s , prefix ):
189
- """Remove prefix from string."""
190
- # TODO usage may be replaced by .removeprefix() in python >=3.9
191
- if prefix and s .startswith (prefix ):
192
- return s [len (prefix ):]
193
- return s
194
-
195
- @log .log_function ()
196
- def rchop (self , s , suffix ):
197
- """Remove suffix from string."""
198
- # TODO usage may be replaced by .removesuffix() in python >=3.9
199
- if suffix and s .endswith (suffix ):
200
- return s [:- len (suffix )]
201
- return s
202
187
203
188
# Identify connected GPU card (card0, card1 etc.)
204
189
@log .log_function ()
@@ -479,9 +464,9 @@ def get_available_builds(self, shortname=None):
479
464
480
465
def pretty_filename (s ):
481
466
"""Make filenames prettier to users."""
482
- s = self . lchop ( s , f'{ oe .DISTRIBUTION } -{ oe .ARCHITECTURE } -' )
483
- s = self . rchop ( s , '.tar' )
484
- s = self . rchop ( s , '.img.gz' )
467
+ s = s . removeprefix ( f'{ oe .DISTRIBUTION } -{ oe .ARCHITECTURE } -' )
468
+ s = s . removesuffix ( '.tar' )
469
+ s = s . removesuffix ( '.img.gz' )
485
470
return s
486
471
487
472
channel = self .struct ['update' ]['settings' ]['Channel' ]['value' ]
You can’t perform that action at this time.
0 commit comments