Skip to content

Instantly share code, notes, and snippets.

@jon-weisz
Created January 3, 2017 18:59
Show Gist options
  • Save jon-weisz/69e698a694bd94b05b7ebeb424297aef to your computer and use it in GitHub Desktop.
Save jon-weisz/69e698a694bd94b05b7ebeb424297aef to your computer and use it in GitHub Desktop.
View Meta UIC
class ViewMeta(type):
def __new__(cls, name, parents, dct):
if 'uic_file' in dct:
uic_form, uic_base = #magic uic loading
parents_extended = [p for p in parents] + [uic_form, uic_base]
return super(InterfaceMeta, cls).__new__(cls, name, parents_extended, dct)
class ViewClass(object):
__metaclass__ = ViewMeta
uic_file=path_to_uic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment