Added more docstrings

This commit is contained in:
Arjan Schrijver 2013-03-14 12:32:58 +01:00
parent 441296d808
commit 5c15585413
4 changed files with 31 additions and 5 deletions

View File

@ -315,8 +315,8 @@ class MediaManagerItem(QtGui.QWidget):
"""
Turn file from Drag and Drop into an array so the Validate code can run it.
``files``
The list of files to be loaded
``data``
A dictionary containing the list of files to be loaded and the target
"""
new_files = []
error_shown = False
@ -335,6 +335,9 @@ class MediaManagerItem(QtGui.QWidget):
def dnd_move_internal(self, target):
"""
Handle internal moving of media manager items
``target``
The target of the DnD action
"""
pass
@ -345,6 +348,9 @@ class MediaManagerItem(QtGui.QWidget):
``files``
The files to be loaded.
``target_group``
The QTreeWidgetItem of the group that will be the parent of the added files
"""
names = []
full_list = []

View File

@ -219,6 +219,9 @@ class Plugin(QtCore.QObject):
def upgrade_settings(self, settings):
"""
Upgrade the settings of this plugin.
``settings``
The Settings object containing the old settings.
"""
pass

View File

@ -64,9 +64,11 @@ class TreeWidgetWithDnD(QtGui.QTreeWidget):
def mouseMoveEvent(self, event):
"""
Drag and drop event does not care what data is selected
as the recipient will use events to request the data move
just tell it what plugin to call
Drag and drop event does not care what data is selected as the recipient will use events to request the data
move just tell it what plugin to call
``event``
The event that occurred
"""
if event.buttons() != QtCore.Qt.LeftButton:
event.ignore()
@ -81,6 +83,12 @@ class TreeWidgetWithDnD(QtGui.QTreeWidget):
drag.start(QtCore.Qt.CopyAction)
def dragEnterEvent(self, event):
"""
Receive drag enter event, check if it is a file or internal object and allow it if it is.
``event``
The event that occurred
"""
if event.mimeData().hasUrls():
event.accept()
elif self.allow_internal_dnd:
@ -89,6 +97,12 @@ class TreeWidgetWithDnD(QtGui.QTreeWidget):
event.ignore()
def dragMoveEvent(self, event):
"""
Receive drag move event, check if it is a file or internal object and allow it if it is.
``event``
The event that occurred
"""
QtGui.QTreeWidget.dragMoveEvent(self, event)
if event.mimeData().hasUrls():
event.setDropAction(QtCore.Qt.CopyAction)

View File

@ -83,6 +83,9 @@ class ImagePlugin(Plugin):
def upgrade_settings(self, settings):
"""
Upgrade the settings of this plugin.
``settings``
The Settings object containing the old settings.
"""
files_from_config = settings.get_files_from_config(self)
if len(files_from_config) > 0: