Пример #1
0
    def add(self, mouse_name, address, customer_names=[]):

        exists = mouse_exists(mouse_name)
        if exists:
            return(
                MightyMouseResults(
                    self.username, self.uri, self.method
                ).exist(mouse_name)
            )
        else:
            status = (
                add_mouse(
                    customer_names, mouse_name, address,
                    self.username, self.uri, self.method
                )
            )
            return(status)
Пример #2
0
    def update(self, mouse_name, customer_names=[], address=None):

        exists = mouse_exists(mouse_name)
        if exists:
            status = (
                update_mouse(
                    exists, mouse_name, customer_names,
                    address, self.username, self.uri, self.method
                )
            )
        else:
            status = (
                add_mouse(
                    customer_names, mouse_name, address,
                    self.username, self.uri, self.method
                )
            )

        return(status)