Exemplo n.º 1
0
 def create(self, filepath):
     """Load the given file. Return a book object."""
     p = Pdf(filepath)
     b = Book()
     try:
         p.load()
         b.title = p.title
         b.author = p.author
         self.__add_format(b, filepath)
     except FileNotFoundError:
         b = None
     return b
Exemplo n.º 2
0
 def __get_mock_book(self):
     b = Book()
     b.id = 1414
     b.title = "Title"
     b.author = "An Author"
     b.author_uri = "about:none"
     f = BookFormat()
     b.formats = [f, f, f]
     return b
Exemplo n.º 3
0
 def __get_treasure_island(self):
     b = Book()
     b.id = "1"
     b.title = "Treasure Island"
     b.author = "Robert Louis Stevenson"
     return b
Exemplo n.º 4
0
 def __get_great_expectations():
     b = Book()
     b.author = "Charles Dickens"
     b.author = "Great Expectations"
     return b 
Exemplo n.º 5
0
 def __get_treasure_sland():
     b = Book()
     b.author = "Robert Louis Stevenson"
     b.title = "Treasure Island"
     return b
Exemplo n.º 6
0
 def __get_book(self):
     my_book = Book()
     my_book.id = 1337
     return my_book
Exemplo n.º 7
0
 def __convert_search_result_to_book(self, books, result):
     b = Book()
     b.id, b.title, b.author = result
     self.__add_formats_to_book(b)
     books.append(b)