Skip to content

Instantly share code, notes, and snippets.

View PaulSchweizer's full-sized avatar

Paul Schweizer PaulSchweizer

View GitHub Profile
@PaulSchweizer
PaulSchweizer / flow_pyblish.py
Created August 6, 2019 11:07
Pyblish with Flowpipe
"""Convert a pyblish context with collected instances to a flowpipe graph:
+----------------------------+ +----------------------------+ +-----------------------------+
| ValidatorA Instance 0 | | ExtractorA Instance 0 | | IntegratorA Instance 0 |
|----------------------------| |----------------------------| |-----------------------------|
% contexts | % contexts | % contexts |
o contexts.0<{"results"> | +--->o contexts.0<> | +--->o contexts.0<> |
o instance<{"data": {> | |--->o contexts.1<> | |--->o instance<> |
o plugin<"Validator> | |--->o instance<> | | o plugin<"Integrato> |
o step<"validate"> | | o plugin<"Extractor> | | o step<"integrate> |
@PaulSchweizer
PaulSchweizer / change_methods_on_new.py
Last active November 13, 2015 01:06
Change class methods on __new__
class MyClass(object):
""""""
def __new__(cls, *args, **kwargs):
"""@todo documentation for __new__
@param cls The class to create
"""
created_class = super(MyClass, cls).__new__(cls, *args, **kwargs)
@PaulSchweizer
PaulSchweizer / pysideui.py
Last active December 17, 2018 10:08
PySide UI
import os
import xml.etree.ElementTree as xml
from cStringIO import StringIO
try:
import pysideuic
except:
import pysideuic2 as pysideuic
from Qt import QtWidgets
def ui_class(ui_file):