Ejemplo n.º 1
0
    def __init__(self):
        """ Initialize a QtApplication.

        """
        super(QtApplication, self).__init__()
        self._qapp = QApplication.instance() or QApplication([])
        self.resolver = ProxyResolver(factories=QT_FACTORIES)
Ejemplo n.º 2
0
 def __init__(self, *args, **kwargs):
     """ Initialize a AndroidApplication. Uses jnius to retrieve
         an instance of the activity.
         
     """
     super(AndroidApplication, self).__init__(*args, **kwargs)
     self.resolver = ProxyResolver(factories=factories.ANDROID_FACTORIES)
Ejemplo n.º 3
0
    def __init__(self):
        """ Initialize a WxApplication.

        """
        super(WxApplication, self).__init__()
        self._wxapp = wx.GetApp() or wx.PySimpleApp()
        self.resolver = ProxyResolver(factories=WX_FACTORIES)
Ejemplo n.º 4
0
    def __init__(self):
        """ Initialize a KvApplication.

        """
        super(KvApplication, self).__init__()
        self._kvapp = App()
        self._kvapp.build = self.build
        self.resolver = ProxyResolver(factories=kv_factories.KV_FACTORIES)
        kv_factories.KV_FACTORIES = self.resolver.factories  # So any dynamic loads get added
Ejemplo n.º 5
0
    def __init__(self,*args,**kwargs):
        """ Initialize a WebApplication.

        """
        super(LxmlApplication, self).__init__(*args,**kwargs)
        self.resolver = ProxyResolver(factories=lxml_components.FACTORIES)

        if self.debug and self.auto_reload:
            self.init_reloader()
Ejemplo n.º 6
0
    def __init__(self, activity=None):
        """ Initialize a AndroidApplication. Uses jnius to retrieve
            an instance of the activity.
            
        """
        super(AndroidApplication, self).__init__()
        self.resolver = ProxyResolver(factories=factories.ANDROID_FACTORIES)

        #: Add a ActivityLifecycleListener to update the application state
        self.widget.addActivityLifecycleListener(self.widget.getId())
        self.widget.onActivityLifecycleChanged.connect(
            self.on_activity_lifecycle_changed)

        #: Add BackPressedListener to trigger the event
        self.widget.addBackPressedListener(self.widget.getId())
        self.widget.onBackPressed.connect(self.on_back_pressed)
Ejemplo n.º 7
0
    def __init__(self,  appname=None):
        """ Initialize a QtApplication.
        
        Parameters
        ----------
        appname : str, optional
            Explicit application name to use for setting the WM_CLASS attribute 
            on Linux.

        """
        super(QtApplication, self).__init__()
        if appname is not None:
            self._qapp = QApplication.instance() or QApplication([appname])
        else:
            self._qapp = QApplication.instance() or QApplication([])
            
        self.resolver = ProxyResolver(factories=QT_FACTORIES)
Ejemplo n.º 8
0
    def __init__(self, *args, **kwargs):
        """ Initialize a WebApplication.

        """
        super(WebApplication, self).__init__(*args, **kwargs)
        self.resolver = ProxyResolver(factories=lxml_components.FACTORIES)
Ejemplo n.º 9
0
 def __init__(self, *args, **kwargs):
     """ Initialize a IPhoneApplication.
     
     """
     super(IPhoneApplication, self).__init__(*args, **kwargs)
     self.resolver = ProxyResolver(factories=factories.IOS_FACTORIES)
Ejemplo n.º 10
0
 def __init__(self, platform="ios"):
     self.resolver = ProxyResolver()
     self.reset(platform)  # Default
     self.debug = True
     super(MockApplication, self).__init__()
Ejemplo n.º 11
0
 def _default_resolver(self):
     """Return a bridge object reference to the MainActivity"""
     return ProxyResolver(factories=factories.ANDROID_FACTORIES)