wpiformat/wpiformat/config.py
def read_file(directory, file_name):
        """Find file and return contents.

        Checks current directory for file. If one doesn't exist, try all parent
        directories as well.

        Keyword arguments:
        directory -- current directory from which to start search
        file_name -- file name string

        Returns tuple of file name and list containing file contents or triggers
        program exit.
        """
        file_found = False
        while not file_found:
            try:
                with open(directory + os.sep + file_name, "r") as file_contents:
                    file_found = True
                    return os.path.join(
                        directory,
                        file_name), file_contents.read().splitlines()
            except OSError:
                # .git files are ignored, which are created within submodules
                if os.path.isdir(directory + os.sep + ".git"):
                    print("Error: config file '" + file_name +
                          "' not found in '" + directory + "'")
                    sys.exit(1)
                directory = os.path.dirname(directory)
Find file and return contents.

        Checks current directory for file. If one doesn't exist, try all parent
        directories as well.

        Keyword arguments:
        directory -- current directory from which to start search
        file_name -- file name string

        Returns tuple of file name and list containing file contents or triggers
        program exit.
        
Find file and return contents.
Checks current directory for file. If one doesn't exist, try all parent
directories as well.

Keyword arguments:
directory -- current directory from which to start search
file_name -- file name string

Returns tuple of file name and list containing file contents or triggers
program exit.
Find file and return contents . Checks current directory for file . If one doesn ' t exist try all parent directories as well . Keyword arguments : directory -- current directory from which to start search file_name -- file name string Returns tuple of file name and list containing file contents or triggers program exit .
def read_file(directory, file_name):
        file_found = False
        while not file_found:
            try:
                with open(directory + os.sep + file_name, "r") as file_contents:
                    file_found = True
                    return os.path.join(
                        directory,
                        file_name), file_contents.read().splitlines()
            except OSError:
                if os.path.isdir(directory + os.sep + ".git"):
                    print("Error: config file '" + file_name +
                          "' not found in '" + directory + "'")
                    sys.exit(1)
                directory = os.path.dirname(directory)
def read_file ( directory , file_name ) : file_found = False while not file_found : try : with open ( directory + os . sep + file_name , "r" ) as file_contents : file_found = True return os . path . join ( directory , file_name ) , file_contents . read ( ) . splitlines ( ) except OSError : if os . path . isdir ( directory + os . sep + ".git" ) : print ( "Error: config file '" + file_name + "' not found in '" + directory + "'" ) sys . exit ( 1 ) directory = os . path . dirname ( directory )
Find file and return contents.
Find file and return contents .
"""Find file and return contents.

        Checks current directory for file. If one doesn't exist, try all parent
        directories as well.

        Keyword arguments:
        directory -- current directory from which to start search
        file_name -- file name string

        Returns tuple of file name and list containing file contents or triggers
        program exit.
        """ # .git files are ignored, which are created within submodules
directory
file_name