Example #1
0
    def parse(self, args):
        if args.file:
            args.file.close()
            cfg = path(args.file.name)
        else:
            cfg = self.dir / "etc" / "omero.properties"

        from omero.install.config_parser import PropertyParser
        pp = PropertyParser()
        pp.parse_file(str(cfg.abspath()))

        # Parse PSQL profile file
        for p in pp:
            if p.key == "omero.db.profile":
                psql_file = self.dir / "etc" / "profiles" / p.val
                pp.parse_file(str(psql_file.abspath()))
                break

        # Parse OMERO.web configuration properties
        if not args.no_web:
            pp.parse_module('omeroweb.settings')

        # Display options
        if args.headers:
            pp.print_headers()
        elif args.keys:
            pp.print_keys()
        elif args.rst:
            pp.print_rst()
        else:
            pp.print_defaults()