scripts/version_manager.py
def get_version(self) -> str:
        """
        Open the file referenced in this object, and scrape the version.

        :return:
            The version as a string, an empty string if there is no match
            to the magic_line, or any file exception messages encountered.
        """

        try:
            f = open(self.file_path, 'r')
            lines = f.readlines()
            f.close()
        except Exception as e:
            return str(e)

        result = ''

        for line in lines:
            if self.magic_line in line:
                start = len(self.magic_line)
                end = len(line) - self.strip_end_chars
                result = line[start:end]
                break

        return result
def get_version(self) -> str:
        try:
            f = open(self.file_path, 'r')
            lines = f.readlines()
            f.close()
        except Exception as e:
            return str(e)

        result = ''

        for line in lines:
            if self.magic_line in line:
                start = len(self.magic_line)
                end = len(line) - self.strip_end_chars
                result = line[start:end]
                break

        return result
def get_version ( self ) -> str : try : f = open ( self . file_path , 'r' ) lines = f . readlines ( ) f . close ( ) except Exception as e : return str ( e ) result = '' for line in lines : if self . magic_line in line : start = len ( self . magic_line ) end = len ( line ) - self . strip_end_chars result = line [ start : end ] break return result
Open the file referenced in this object, and scrape the version.

        :return:
            The version as a string, an empty string if there is no match
            to the magic_line, or any file exception messages encountered.
Open the file referenced in this object and scrape the version .