parameters: (fileName, bBrowseIfDir=1)
return_statement: return win32ui.FullPath(fileName)
docstring: Given a file name, return a fully qualified file name, or None
docstring_summary: Given a file name, return a fully qualified file name, or None
docstring_tokens: Given a file name return a fully qualified file name or None
function: def LocatePythonFile(fileName, bBrowseIfDir=1):
      "Given a file name, return a fully qualified file name, or None"
      # first look for the exact file as specified
      if not os.path.isfile(fileName):
          # Go looking!
          baseName = fileName
          for path in sys.path:
              fileName = os.path.abspath(os.path.join(path, baseName))
              if os.path.isdir(fileName):
                  if bBrowseIfDir:
                      d = win32ui.CreateFileDialog(
                          1, "*.py", None, 0, "Python Files (*.py)|*.py|All files|*.*"
                      )
                      d.SetOFNInitialDir(fileName)
                      rc = d.DoModal()
                      if rc == win32con.IDOK:
                          fileName = d.GetPathName()
                          break
                      else:
                          return None
              else:
                  fileName = fileName + ".py"
                  if os.path.isfile(fileName):
                      break  # Found it!
  
          else:  # for not broken out of
              return None
      return win32ui.FullPath(fileName)
function_tokens: def LocatePythonFile ( fileName , bBrowseIfDir = 1 ) : # first look for the exact file as specified if not os . path . isfile ( fileName ) : # Go looking! baseName = fileName for path in sys . path : fileName = os . path . abspath ( os . path . join ( path , baseName ) ) if os . path . isdir ( fileName ) : if bBrowseIfDir : d = win32ui . CreateFileDialog ( 1 , "*.py" , None , 0 , "Python Files (*.py)|*.py|All files|*.*" ) d . SetOFNInitialDir ( fileName ) rc = d . DoModal ( ) if rc == win32con . IDOK : fileName = d . GetPathName ( ) break else : return None else : fileName = fileName + ".py" if os . path . isfile ( fileName ) : break # Found it! else : # for not broken out of return None return win32ui . FullPath ( fileName )