コード例 #1
0
ファイル: __init__.py プロジェクト: kiberpipa/mediacore
 def display(self, value, **kwargs):
     """Display the form with default values from the engine param."""
     engine = kwargs['engine']
     general = value.setdefault('general', {})
     if not general.get('display_name', None):
         general['display_name'] = engine.display_name
     return ListForm.display(self, value, **kwargs)
コード例 #2
0
ファイル: players.py プロジェクト: nks0ne/mediacore-community
    def display(self, value, player, **kwargs):
        """Display the form with default values from the given player.

        If the value dict is not fully populated, populate any missing entries
        with the values from the given player's
        :attr:`_data <mediacore.model.player.PlayerPrefs._data>` dict.

        :param value: A (sparse) dict of values to populate the form with.
        :type value: dict
        :param player: The player prefs mapped object to retrieve the default
            values from.
        :type player: :class:`mediacore.model.player.PlayerPrefs` subclass

        """
        return ListForm.display(self, value, **kwargs)
コード例 #3
0
ファイル: players.py プロジェクト: nks0ne/mediacore-community
    def display(self, value, player, **kwargs):
        """Display the form with default values from the given player.

        If the value dict is not fully populated, populate any missing entries
        with the values from the given player's
        :attr:`_data <mediacore.model.player.PlayerPrefs._data>` dict.

        :param value: A (sparse) dict of values to populate the form with.
        :type value: dict
        :param player: The player prefs mapped object to retrieve the default
            values from.
        :type player: :class:`mediacore.model.player.PlayerPrefs` subclass

        """
        return ListForm.display(self, value, **kwargs)
コード例 #4
0
    def display(self, value, engine, **kwargs):
        """Display the form with default values from the given StorageEngine.

        If the value dict is not fully populated, populate any missing entries
        with the values from the given StorageEngine's
        :attr:`_data <mediacore.lib.storage.StorageEngine._data>` dict.

        :param value: A (sparse) dict of values to populate the form with.
        :type value: dict
        :param engine: An instance of the storage engine implementation.
        :type engine: :class:`mediacore.lib.storage.StorageEngine` subclass

        """
        general = value.setdefault('general', {})
        if not general.get('display_name', None):
            general['display_name'] = engine.display_name
        return ListForm.display(self, value, engine=engine, **kwargs)
コード例 #5
0
    def display(self, value, engine, **kwargs):
        """Display the form with default values from the given StorageEngine.

        If the value dict is not fully populated, populate any missing entries
        with the values from the given StorageEngine's
        :attr:`_data <mediacore.lib.storage.StorageEngine._data>` dict.

        :param value: A (sparse) dict of values to populate the form with.
        :type value: dict
        :param engine: An instance of the storage engine implementation.
        :type engine: :class:`mediacore.lib.storage.StorageEngine` subclass

        """
        general = value.setdefault('general', {})
        if not general.get('display_name', None):
            general['display_name'] = engine.display_name
        return ListForm.display(self, value, engine=engine, **kwargs)