Coding Standards¶
The following rules and guidelines are used throughout the nodeeditor package:
File naming guidelines¶
files in the nodeeditor package start with
node_files containing graphical representation (PyQt5 overridden classes) start with
node_graphics_files for window/widget start with
node_editor_
Coding guidelines¶
methods use Camel case naming
variables/properties use Snake case naming
The constructor
__init__always contains all class variables for the entire class. This is helpful for new users, so they can just look at the constructor and read about all properties that class is using in one place. Nobody wants any surprises hidden in the code laternodeeditor uses custom callbacks and listeners. Methods for adding callback functions are usually named
addXYListenercustom events are usually named
onXYmethods named
doXYusually do certain tasks and also take care of low level operationsclasses always contain methods in this order:
__init__python magic methods (i.e.
__str__), setters and gettersinitXYfunctionslistener functions
nodeeditor event fuctions
nodeeditor
doXYandgetXYhelping functionsQt5 event functions
other functions
optionally overridden Qt
paintmethodserializeanddeserializemethods at the end