Skip to content

Commit

Permalink
formatting. docs wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ilgarlunin committed Aug 5, 2019
1 parent c0a6c14 commit 127ce24
Show file tree
Hide file tree
Showing 18 changed files with 174 additions and 162 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ To contribute to PyFlow, just use pull requests.

First check for duplicates if possible.
Then try to describe problem as wide as possible,
attaching maximum info possible.
attaching maximum possible info.

Thanks! :heart: :heart: :heart:
29 changes: 2 additions & 27 deletions PyFlow/App.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,8 @@ def populateMenu(self):
packagePlugin.triggered.connect(PackageWizard.run)

helpMenu = self.menuBar.addMenu("Help")
shortcutsAction = helpMenu.addAction("Shortcuts")
shortcutsAction.setIcon(QtGui.QIcon(":/shortcuts_icon.png"))
shortcutsAction.triggered.connect(self.shortcuts_info)
helpMenu.addAction("Homepage").triggered.connect(lambda _=False, url="https://wonderworks-software.github.io/PyFlow/": QtGui.QDesktopServices.openUrl(url))
helpMenu.addAction("Docs").triggered.connect(lambda _=False, url="https://pyflow.readthedocs.io/en/latest/": QtGui.QDesktopServices.openUrl(url))

def showPreferencesWindow(self):
self.preferencesWindow.show()
Expand Down Expand Up @@ -475,30 +474,6 @@ def closeEvent(self, event):

QMainWindow.closeEvent(self, event)

def shortcuts_info(self):

data = "Tab - togle node box\n"
data += "Ctrl+N - new file\n"
data += "Ctrl+S - save\n"
data += "Ctrl+Shift+S - save as\n"
data += "Ctrl+O - open file\n"
data += "F - frame selected\n"
data += "H - frame all\n"
data += "C - comment selected nodes\n"
data += "Delete - kill selected nodes\n"
data += "Ctrl+C - Copy\n"
data += "Ctrl+V - Paste\n"
data += "Alt+Drag - Duplicate\n"
data += "Ctrl+Z - Undo\n"
data += "Ctrl+Y - Redo\n"
data += "Alt+Click - Disconnect Pin\n"
data += "Ctrl+Shift+ArrowLeft - Align left\n"
data += "Ctrl+Shift+ArrowUp - Align Up\n"
data += "Ctrl+Shift+ArrowRight - Align right\n"
data += "Ctrl+Shift+ArrowBottom - Align Bottom\n"

QMessageBox.information(self, "Shortcuts", data)

@staticmethod
def instance(parent=None, software=""):
assert(software != ""), "Invalid arguments. Please pass you software name as second argument!"
Expand Down
2 changes: 1 addition & 1 deletion PyFlow/Core/NodeBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def getMetaData(self):
This will return dict only for function based nodes. For class based nodes it will return None
.. seelaso:: :mod:`~PyFlow.Core.FunctionLibrary`
.. seealso:: :mod:`~PyFlow.Core.FunctionLibrary`
:rtype: dict or None
"""
Expand Down
10 changes: 5 additions & 5 deletions PyFlow/Packages/PyFlowBase/Pins/AnyPin.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def serialize(self):
Appends current value and currentDataType to default :py:func:`PyFlow.Core.PinBase.PinBase.serialize` method
:returns: json data
:rtype: {dict}
:rtype: dict
"""
dt = super(AnyPin, self).serialize()
constrainedType = self.activeDataType
Expand Down Expand Up @@ -252,7 +252,7 @@ def pinDisconnected(self, other):
def updateOnConnectionCallback(self, pin, dataType, init=False, other=None):
"""Method Called in traverse function :py:func:`PyFlow.Core.Common.traverseConstrainedPins`
This Function is called for all the connected Pins to the initial Pin calling it.
This Function is called for all the connected Pins to the initial Pin calling it.
Here we traverse all pins and call :py:func:`AnyPin.setType` for all of them.
We also intersect all the connected pins allowedDataTypes.
:param pin: Pin to perform operations on
Expand Down Expand Up @@ -297,7 +297,7 @@ def checkFree(self, checked=[], selfCheck=True):
the only conection that make hole graphed nodes not be able to change Type, defaults to True
:type selfCheck: bool, optional
:returns: True if Pin can change current dataType
:rtype: {bool}
:rtype: bool
"""
if self.constraint is None or self.dataType == self.__class__.__name__:
return True
Expand Down Expand Up @@ -373,7 +373,7 @@ def initType(self, dataType, initializing=False):
:param initializing: If initializing AnyPin can have same strenght as other types, if not, "AnyPin" Pin will always be weaker than other dataType, if, defaults to False
:type initializing: bool, optional
:returns: True if it can change to the asked dataType
:rtype: {bool}
:rtype: bool
"""
if self.canChangeTypeOnConnection([], self.optionEnabled(PinOptions.ChangeTypeOnConnection), []):
traverseConstrainedPins(
Expand All @@ -391,7 +391,7 @@ def setType(self, dataType):
:param dataType: New DataType
:type dataType: string
:returns: True if succes setting dataType
:rtype: {bool}
:rtype: bool
"""
if self.activeDataType == dataType:
return True
Expand Down
4 changes: 0 additions & 4 deletions PyFlow/Packages/PyFlowBase/Tools/HistoryTool.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ def onClear(self):
def isSingleton():
return True

@staticmethod
def getIcon():
return QtGui.QIcon(":history.png")

@staticmethod
def defaultDockArea():
return QtCore.Qt.LeftDockWidgetArea
Expand Down
4 changes: 0 additions & 4 deletions PyFlow/Packages/PyFlowBase/Tools/LoggerTool.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,6 @@ def update(self):
"rgba%s" % str(editableStyleSheet().LoggerBgColor.getRgb()))
super(LoggerTool, self).update()

@staticmethod
def getIcon():
return QtGui.QIcon(":logger.png")

def onShow(self):
super(LoggerTool, self).onShow()

Expand Down
4 changes: 0 additions & 4 deletions PyFlow/Packages/PyFlowBase/Tools/NodeBoxTool.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ class NodeBoxTool(DockTool):
def __init__(self):
super(NodeBoxTool, self).__init__()

@staticmethod
def getIcon():
return QtGui.QIcon(":nodeBox.png")

def onShow(self):
super(NodeBoxTool, self).onShow()
self.setMinimumSize(QtCore.QSize(200, 50))
Expand Down
4 changes: 0 additions & 4 deletions PyFlow/Packages/PyFlowBase/Tools/PropertiesTool.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ def assignPropertiesWidget(self, propertiesFillDelegate):
self.fillDelegate = propertiesFillDelegate
propertiesFillDelegate(self.propertiesWidget)

@staticmethod
def getIcon():
return QtGui.QIcon(":property_icon.png")

@staticmethod
def isSingleton():
return False
Expand Down
4 changes: 0 additions & 4 deletions PyFlow/Packages/PyFlowBase/Tools/SearchResultsTool.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ def onShowNodesResults(self, uiNodesList):
def defaultDockArea():
return QtCore.Qt.BottomDockWidgetArea

@staticmethod
def getIcon():
return QtGui.QIcon(":binocular.png")

def onShow(self):
super(SearchResultsTool, self).onShow()
self.pyFlowInstance.getCanvas().requestShowSearchResults.connect(self.onShowNodesResults)
Expand Down
4 changes: 0 additions & 4 deletions PyFlow/Packages/PyFlowBase/Tools/VariablesTool.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ def __init__(self):
self.verticalLayout.setObjectName("verticalLayout")
self.setWidget(self.content)

@staticmethod
def getIcon():
return QtGui.QIcon(":variable.png")

@staticmethod
def isSingleton():
return True
Expand Down
44 changes: 44 additions & 0 deletions PyFlow/UI/UIInterfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ def createPropertiesWidget(self, propertiesWidget):


class IDataExporter(object):
"""Data exporter/importer
Editor data can be exported/imported to/from arbitrary formats
"""
def __init__(self):
super(IDataExporter, self).__init__()

Expand Down Expand Up @@ -69,41 +73,81 @@ def doExport(pyFlowInstance):


class IPackage(object):
"""Class that describes a set of modules that can be plugged into the editor.
Will be instantiated and used to create registered entities.
"""
def __init__(self):
super(IPackage, self).__init__()

@staticmethod
def GetExporters():
"""Registered editor data exporters
:rtype: dict(str, class)
"""
raise NotImplementedError('GetExporters method of IPackage is not implemented')

@staticmethod
def GetFunctionLibraries():
"""Registered function library instances
:rtype: dict(str, object)
"""
raise NotImplementedError('GetFunctionLibraries method of IPackage is not implemented')

@staticmethod
def GetNodeClasses():
"""Registered node classes
:rtype: dict(str, class)
"""
raise NotImplementedError('GetNodeClasses method of IPackage is not implemented')

@staticmethod
def GetPinClasses():
"""Registered pin classes
:rtype: dict(str, class)
"""
raise NotImplementedError('GetPinClasses method of IPackage is not implemented')

@staticmethod
def GetToolClasses():
"""Registered tool classes
:rtype: dict(str, class)
"""
raise NotImplementedError('GetToolClasses method of IPackage is not implemented')

@staticmethod
def UIPinsFactory():
"""Registered ui pin wrappers
:rtype: function
"""
return None

@staticmethod
def UINodesFactory():
"""Registered ui nodes
:rtype: function
"""
return None

@staticmethod
def PinsInputWidgetFactory():
"""Registered pin input widgets
:rtype: function
"""
return None

@staticmethod
def PrefsWidgets():
"""Registered preferences widgets
:rtype: dict(str, class)
"""
return None
Loading

0 comments on commit 127ce24

Please sign in to comment.