source/riffle/icon_factory.py
def icon(self, specification):
        '''Return appropriate icon for *specification*.

        *specification* should be either:

            * An instance of :py:class:`riffle.model.Item`
            * One of the defined icon types (:py:class:`IconType`)

        '''
        if isinstance(specification, riffle.model.Item):
            specification = self.type(specification)

        icon = None

        if specification == IconType.Computer:
            icon = QtGui.QIcon(':riffle/icon/computer')

        elif specification == IconType.Mount:
            icon = QtGui.QIcon(':riffle/icon/drive')

        elif specification == IconType.Directory:
            icon = QtGui.QIcon(':riffle/icon/folder')

        elif specification == IconType.File:
            icon = QtGui.QIcon(':riffle/icon/file')

        elif specification == IconType.Collection:
            icon = QtGui.QIcon(':riffle/icon/collection')

        return icon
def icon(self, specification):
        '''Return appropriate icon for *specification*.

        *specification* should be either:

            * An instance of :py:class:`riffle.model.Item`
            * One of the defined icon types (:py:class:`IconType`)

        '''
        if isinstance(specification, riffle.model.Item):
            specification = self.type(specification)

        icon = None

        if specification == IconType.Computer:
            icon = QtGui.QIcon(':riffle/icon/computer')

        elif specification == IconType.Mount:
            icon = QtGui.QIcon(':riffle/icon/drive')

        elif specification == IconType.Directory:
            icon = QtGui.QIcon(':riffle/icon/folder')

        elif specification == IconType.File:
            icon = QtGui.QIcon(':riffle/icon/file')

        elif specification == IconType.Collection:
            icon = QtGui.QIcon(':riffle/icon/collection')

        return icon
Return appropriate icon for *specification*.

        *specification* should be either:

            * An instance of :py:class:`riffle.model.Item`
            * One of the defined icon types (:py:class:`IconType`)