Create a new book

def create_book(self, name):
        """Create a new book"""
        name = name.strip()
        if not len(name):
            self.error("Cannot have a blank book name")
        # The next could be relaxed, if users want commas in book names, but
        # I prefer to keep it, in case later there could be a syntax for multiple
        # book names, using comma.
        if name.find(",") >= 0:
            self.error("Cannot have a ',' in a book name")
        existing = self.list_books()
        nexisting = len(existing)
        if name in existing:
            self.error("Already have a book named '%s'" % name)
        try:
            self.cur.execute("INSERT INTO book (number, name) VALUES(?, ?);", (nexisting, name))
            self.con.commit()
        except:
            self.fyi("Error adding a book named '%s'" % name)