Exemple #1
0
    def __getattribute__(cls, name):
        try:
            return type.__getattribute__(cls, name)
        except AttributeError:
            # Handle internal (ie. non-PySide) attributes as normal.
            if name == "module":
                raise

            # Avoid a circular import.
            from pyside2uic.Compiler.qtproxies import LiteralProxyClass

            return type(
                name,
                (LiteralProxyClass,),
                {"module": moduleMember(type.__getattribute__(cls, "module"), type.__getattribute__(cls, "__name__"))},
            )
Exemple #2
0
    def __init__(self, objectname, is_attribute, args=(), noInstantiation=False):
        if objectname:
            if is_attribute:
                objectname = "self." + objectname

            self._uic_name = objectname
        else:
            self._uic_name = "Unnamed"

        if not noInstantiation:
            funcall = "%s(%s)" % (moduleMember(self.module, self.__class__.__name__), ", ".join(map(str, args)))

            if objectname:
                funcall = "%s = %s" % (objectname, funcall)

            write_code(funcall)
Exemple #3
0
    def __getattribute__(cls, name):
        try:
            return type.__getattribute__(cls, name)
        except AttributeError:
            # Handle internal (ie. non-PySide) attributes as normal.
            if name == "module":
                raise

            # Avoid a circular import.
            from pyside2uic.Compiler.qtproxies import LiteralProxyClass

            return type(
                name, (LiteralProxyClass, ), {
                    "module":
                    moduleMember(type.__getattribute__(cls, "module"),
                                 type.__getattribute__(cls, "__name__"))
                })
    def __init__(self, objectname, is_attribute, args=(), noInstantiation=False):
        if objectname:
            if is_attribute:
                objectname = "self." + objectname

            self._uic_name = objectname
        else:
            self._uic_name = "Unnamed"

        if not noInstantiation:
            funcall = "%s(%s)" % \
                    (moduleMember(self.module, self.__class__.__name__),
                    ", ".join(map(str, args)))

            if objectname:
                funcall = "%s = %s" % (objectname, funcall)

            write_code(funcall)
Exemple #5
0
 def __init__(self, *args):
     self._uic_name = "%s(%s)" % (
         moduleMember(self.module, self.__class__.__name__),
         ", ".join(map(as_string, args)),
     )
Exemple #6
0
 def __str__(cls):
     return moduleMember(type.__getattribute__(cls, "module"),
                         type.__getattribute__(cls, "__name__"))
 def __init__(self, *args):
     self._uic_name = "%s(%s)" % \
                  (moduleMember(self.module, self.__class__.__name__),
                   ", ".join(map(as_string, args)))
Exemple #8
0
 def __str__(cls):
     return moduleMember(type.__getattribute__(cls, "module"), type.__getattribute__(cls, "__name__"))