(self)
return path
Simple validity check for menu file path
Simple validity check for menu file path
Simple validity check for menu file path
def path_ok(self):
        "Simple validity check for menu file path"
        path = self.path.get().strip()
        if not path: #no path specified
            self.showerror('no help file path specified.', self.path_error)
            return None
        elif not path.startswith(('www.', 'http')):
            if path[:5] == 'file:':
                path = path[5:]
            if not os.path.exists(path):
                self.showerror('help file path does not exist.',
                               self.path_error)
                return None
            if platform == 'darwin':  # for Mac Safari
                path =  "file://" + path
        return path
def path_ok ( self ) : path = self . path . get ( ) . strip ( ) if not path : #no path specified self . showerror ( 'no help file path specified.' , self . path_error ) return None elif not path . startswith ( ( 'www.' , 'http' ) ) : if path [ : 5 ] == 'file:' : path = path [ 5 : ] if not os . path . exists ( path ) : self . showerror ( 'help file path does not exist.' , self . path_error ) return None if platform == 'darwin' : # for Mac Safari path = "file://" + path return path