File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -184,21 +184,6 @@ def do_init(self):
184184 def exit (self ):
185185 pass
186186
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
202187
203188 # Identify connected GPU card (card0, card1 etc.)
204189 @log .log_function ()
@@ -479,9 +464,9 @@ def get_available_builds(self, shortname=None):
479464
480465 def pretty_filename (s ):
481466 """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' )
485470 return s
486471
487472 channel = self .struct ['update' ]['settings' ]['Channel' ]['value' ]
You can’t perform that action at this time.
0 commit comments