From 2d33ed415742961cc520400658e9ab3774e769ea Mon Sep 17 00:00:00 2001 From: Quintijn Date: Fri, 16 Feb 2024 16:06:03 +0100 Subject: [PATCH] tidy up detail --- src/unimacro/UnimacroGrammars/_folders.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/unimacro/UnimacroGrammars/_folders.py b/src/unimacro/UnimacroGrammars/_folders.py index 9b5a477..3ef4d72 100644 --- a/src/unimacro/UnimacroGrammars/_folders.py +++ b/src/unimacro/UnimacroGrammars/_folders.py @@ -58,6 +58,7 @@ import natlink from natlinkcore import readwritefile from natlinkcore import natlinktimer +from natlinkcore import natlinkstatus from dtactions.unimacro import extenvvars from dtactions import messagefunctions as mess from dtactions import natlinkclipboard @@ -73,7 +74,7 @@ # import natlinkcore.natlinkutils as natut thisDir = str(Path(__file__).parent) - +status = natlinkstatus.NatlinkStatus() # for getting unicode explorer window titles: GetWindowText = ctypes.windll.user32.GetWindowTextW GetWindowTextLength = ctypes.windll.user32.GetWindowTextLengthW @@ -95,10 +96,6 @@ doRecentFolderCommand = True # some child windows have to behave as top window (specified in ini file): # note: title is converted to lowercase, only full title is recognised -try: - thisGrammar -except NameError: - thisGrammar = None ancestor = natbj.IniGrammar class ThisGrammar(ancestor): @@ -298,7 +295,7 @@ def fillInstanceVariables(self): if self.trackFoldersInterval: print(f'track active folder every {interval:f.1} seconds') self.recentfoldersDict = {} - inipath = self.ini.getFilename() + # inipath = self.ini.getFilename() self.pickleChangingData = Path(status.getUnimacroDataDirectory())/"recentfoldersdata.pickle" ## automatic tracking of recent folders : @@ -2017,6 +2014,7 @@ def getValidDirectory(self, f, remote): return tryF fparts.pop(0) print('_folders, no valid remote folder found for %s and remote: %s'% (f, remote)) + return '' def getValidFile(self, f, remote): _fdrive, fdir = os.path.splitdrive(f) @@ -2028,6 +2026,7 @@ def getValidFile(self, f, remote): return tryF fparts.pop(0) print('_folders, no valid remote file found for %s and remote: %s'% (f, remote)) + return '' def gotResults(self, words,fullResults):