def main()

in SQLDeveloper/SQLDeveloperVersioner.py [0:0]


    def main(self):
        # Unsurprisingly, SQLDeveloper fails to include a useful version in
        # the app's Info.plist.  Instead, the actual version is buried deep
        # inside in a file called "version.properties". Thanks, Oracle.
        # You know, I was a having a pretty good day up until now...
        relative_path = (
            "Contents/Resources/sqldeveloper/sqldeveloper/bin/version.properties"
        )
        file_path = os.path.join(self.env["app_path"], relative_path)
        # this code stolen directly from
        # http://stackoverflow.com/questions/2819696/parsing-properties-file-in-python/2819788#2819788
        cp = ConfigParser.SafeConfigParser()
        try:
            cp.readfp(FakeSecHead(open(file_path)))
        except IOError as err:
            raise ProcessorError(err)
        self.env["version"] = cp.get("properties", "ver_full")
        self.output("Version: %s" % self.env["version"])