2929LOG = logger .getLogger (__name__ )
3030
3131# Force the log level for this module
32- LOG .setLevel (logger .DEBUG ) # One of DEBUG, INFO, WARNING, ERROR, CRITICAL
32+ # LOG.setLevel(logger.DEBUG) # One of DEBUG, INFO, WARNING, ERROR, CRITICAL
3333
3434_translate = QCoreApplication .translate
3535
@@ -317,7 +317,7 @@ def initUI(self):
317317 def _hal_init (self ):
318318 if self .PREFS_ :
319319 last_path = self .PREFS_ .getpref ('last_loaded_directory' , self .user_path , str , 'BOOK_KEEPING' )
320- LOG .debug ("LAST FILE PATH: {}" . format ( last_path ) )
320+ LOG .debug (f "LAST FILE PATH: { last_path } " )
321321 if not last_path == '' and os .path .exists (last_path ):
322322 self .updateDirectoryView (last_path )
323323 else :
@@ -328,15 +328,15 @@ def _hal_init(self):
328328 self ._jumpList .update (temp )
329329
330330 else :
331- LOG .debug ("LAST FILE PATH: {}" . format ( self .user_path ) )
331+ LOG .debug (f "LAST FILE PATH: { self .user_path } " )
332332 self .updateDirectoryView (self .user_path )
333333
334334 # install jump paths into toolbutton menu
335335 for i in self ._jumpList :
336336 self .addAction (i )
337337
338338 # set recorded columns sort settings
339- self .SETTINGS_ .beginGroup ("FileManager-{}" . format ( self .objectName ()) )
339+ self .SETTINGS_ .beginGroup (f "FileManager-{ self .objectName ()} " )
340340 sect = self .SETTINGS_ .value ('sortIndicatorSection' , type = int )
341341 order = self .SETTINGS_ .value ('sortIndicatorOrder' , type = int )
342342 self .SETTINGS_ .endGroup ()
@@ -358,7 +358,7 @@ def _hal_cleanup(self):
358358
359359 # record sorted columns
360360 h = self .table .horizontalHeader ()
361- self .SETTINGS_ .beginGroup ("FileManager-{}" . format ( self .objectName ()) )
361+ self .SETTINGS_ .beginGroup (f "FileManager-{ self .objectName ()} " )
362362 self .SETTINGS_ .setValue ('sortIndicatorSection' , h .sortIndicatorSection ())
363363 self .SETTINGS_ .setValue ('sortIndicatorOrder' , h .sortIndicatorOrder ())
364364 self .SETTINGS_ .endGroup ()
@@ -390,9 +390,9 @@ def updateDirectoryView(self, path, quiet = False):
390390 self .table .setRootIndex (proxy_index )
391391 self .proxy_model .invalidate ()
392392 else :
393- LOG .debug ("Set directory view error - no such path {}" . format ( path ) )
393+ LOG .debug (f "Set directory view error - no such path { path } " )
394394 if not quiet :
395- STATUS .emit ('error' , STATUS .TEMPORARY_MESSAGE , "File Manager error - No such path: {}" . format ( path ) )
395+ STATUS .emit ('error' , STATUS .TEMPORARY_MESSAGE , f "File Manager error - No such path: { path } " )
396396
397397 # retrieve selected filter (it's held as QT.userData)
398398 def filterChanged (self , index ):
@@ -430,8 +430,8 @@ def onJumpClicked(self):
430430 if temp is not None :
431431 self .updateDirectoryView (temp )
432432 else :
433- STATUS .emit ('error' ,STATUS .OPERATOR_ERROR , 'file jumppath: {} not valid' . format ( data ) )
434- log .debug ('file jumppath: {} not valid' . format ( data ) )
433+ STATUS .emit ('error' ,STATUS .OPERATOR_ERROR , f 'file jumppath: { data } not valid' )
434+ LOG .debug (f 'file jumppath: { data } not valid' )
435435 else :
436436 self .jumpButton .setText ('User' )
437437
@@ -446,7 +446,7 @@ def jumpTriggered(self, data):
446446 self .jumpButton .setToolTip ('Jump to User directory.\n Long press for Options.' )
447447 self .showUserDir ()
448448 else :
449- self .jumpButton .setToolTip ('Jump to directory:\n {}' . format ( self ._jumpList .get (name )) )
449+ self .jumpButton .setToolTip (f 'Jump to directory:\n { self ._jumpList .get (name )} ' )
450450 self .updateDirectoryView (self ._jumpList .get (name ))
451451
452452 # add or remove a jump list path
@@ -557,7 +557,7 @@ def dropCopy(self, data):
557557 source , dest = data
558558 self .copyChecks (source , dest )
559559
560- def copyFile (self , s , d ):
560+ def copyFile (self , source , dest ):
561561 self .copyChecks (source , dest )
562562
563563 def overwriteMessage (self , d ):
@@ -570,7 +570,7 @@ def overwriteMessage(self, d):
570570 return False
571571 return True
572572
573- # likely class patch candidate
573+ # likely class patch candidate
574574 def copyChecks (self , s , d ):
575575 if os .path .isfile (d ) or os .path .isdir (d ):
576576 retval = self .overwriteMessage (d )
@@ -596,7 +596,7 @@ def copy(self, s, d):
596596 STATUS .emit ('status-message' ,mess ,opt )
597597 return True
598598 except Exception as e :
599- STATUS .emit ('error' , STATUS .OPERATOR_ERROR , "Copy file error: {}" . format ( e ) )
599+ STATUS .emit ('error' , STATUS .OPERATOR_ERROR , f "Copy file error: { e } " )
600600 return False
601601
602602 @pyqtSlot (float )
@@ -669,16 +669,16 @@ def getCurrentSelected(self):
669669 # This can be class patched to do something else
670670 def load (self , fname = None ):
671671 return
672- try :
673- if fname is None :
674- self ._getPathActivated ()
675- return
676- self .recordBookKeeping ()
677- ACTION .OPEN_PROGRAM (fname )
678- STATUS .emit ('update-machine-log' , 'Loaded: ' + fname , 'TIME,SUCCESS' )
679- except Exception as e :
680- LOG .error ("Load file error: {}" . format ( e ) )
681- STATUS .emit ('error' , STATUS .NML_ERROR , "Load file error: {}" . format ( e ) )
672+ # try:
673+ # if fname is None:
674+ # self._getPathActivated()
675+ # return
676+ # self.recordBookKeeping()
677+ # ACTION.OPEN_PROGRAM(fname)
678+ # STATUS.emit('update-machine-log', f 'Loaded: { fname}' , 'TIME,SUCCESS')
679+ # except Exception as e:
680+ # LOG.error(f "Load file error: {e}" )
681+ # STATUS.emit('error', STATUS.NML_ERROR, f "Load file error: {e}" )
682682
683683 # This can be class patched to do something else
684684 def recordBookKeeping (self ):
0 commit comments