Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
"""LICENSE Copyright 2018 Hermann Krumrey <hermann@krumreyh.com>
This file is part of anime-list-apis.
anime-list-apis is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
anime-list-apis is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with anime-list-apis. If not, see <http://www.gnu.org/licenses/>. LICENSE"""
""" An enumeration modelling the different type of titles """
""" Models a title of an entry """
self, titles: Dict[TitleType, str], default: TitleType = TitleType.ROMAJI ): """ Initializes the Title object. In case no valid titles are supplied, a ValueError is raised :param titles: The titles to include :param default: The default title to show. Defaults to ROMAJI :raises TypeError: If an invalid parameter type was provided :raises ValueError: In case no valid titles were provided """ key: value for key, value in titles.items() if self.type_check(value, str) }
# noinspection PyTypeChecker
# noinspection PyTypeChecker
""" Retrieves the title in the provided title format :param title_type: The title type in which to retrieve the title. Defaults to the current default title type :return: The requested title string or None if no title string for the provided title exists """ else:
""" Sets the title of a title type :param title: The title string to set :param title_type: The type of that title :return: None :raises TypeError: If the type of the title string is wrong """
""" Sets the default title type :param title_type: The new default title type :return: None :raises ValueError: If there exists no title entry for the provided title type """ else:
or Dict or List or Tuple or Set]]: """ Serializes the object into a dictionary :return: The serialized form of this object """
or Dict or List or Tuple or Set]]): """ Deserializes a dictionary into an object of this type :param data: The data to deserialize :return: The deserialized object :raises TypeError: If a type error occurred :raises ValueError: If the data could not be deserialized """
""" :return: The default title """ return self.get() |