예제 #1
0
    def __new__(cls, name, bases, attrs):
        # Extra hg commands
        commands = attrs.get('commands', { })

        for cmd_name, command in cls._default_commands.items() + commands.items():
            attrs[cmd_name] = cls._create_hg_command(command)

        return SimpleNodeBase.__new__(cls, name, bases, attrs)
예제 #2
0
    def __new__(cls, name, bases, attrs):
        # Extra git commands
        commands = attrs.get('commands', { })

        for cmd_name, command in cls._default_commands.items() + commands.items():
            attrs[cmd_name] = cls._create_git_command(command,
                                        ignore_exit_status=command in cls._ignore_exit_status)

        return SimpleNodeBase.__new__(cls, name, bases, attrs)
예제 #3
0
    def __new__(cls, name, bases, attrs):
        # Give this Django class management commands, based on the
        # commands dictionary
        commands = attrs.get('commands', { })

        # Default commands
        for cmd_name, command in cls._default_commands.items():
            attrs[cmd_name] = cls._create_task(cmd_name, command,
                                    one_only=(command not in cls._on_every_host))

        # Custom additional commands
        for cmd_name, command in commands.items():
            attrs[cmd_name] = cls._create_task(cmd_name, command)

        return SimpleNodeBase.__new__(cls, name, bases, attrs)