def __call__(self, argv):
        parser = self.get_parser()
        args, extras = parser.parse_known_args(args=argv)

        # Load configuration.
        self.parse_config(args.config)

        # XXX load other actions based on definitions from config.
        if args.action not in self.actions:
            # Unknown action or --help.
            return parser.print_help()

        # Load config fom a specific app, if defined, or use default one.
        self.app = args.app or self.config.get('tipfy', 'app')

        # Fallback to the tipfy section.
        self.config_section = ['tipfy']
        if self.app:
            self.config_section.insert(0, self.app)

        # If app is set, an 'app' value can be used in expansions.
        if self.app:
            self.config.set('DEFAULT', 'app', self.app)

        # Prepend configured paths to sys.path, if any.
        sys.path[:0] = self.config.getlist(self.config_section, 'sys.path', [])

        # Current cwd and app paths.
        self.cwd_path = path.getcwd()
        if self.app:
            default_app_path = self.cwd_path.joinpath(self.app)
            self.app_path = path(self.config.get(self.config_section, 'path',
                default_app_path)).abspath()
        else:
            self.app_path = None

        if args.help:
            # Delegate help to action.
            extras.append('--help')

        action = self.actions[args.action](self, args.action)
        return action(extras)
dataset/ETHPy150Open moraes/tipfy/manage/__init__.py/TipfyManager.__call__/original