Changeset 4536


Ignore:
Timestamp:
07/18/08 19:19:55 (5 years ago)
Author:
john_lee
Message:

modify fso_backend to set mainloop when initialize. use GMainLoop as
default in testing.

  • also modify dialer to reflect the changes.
Location:
developers/john_lee/pyfso
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • developers/john_lee/pyfso/dialer.py

    r4527 r4536  
    7777    """A Dialer implementation based on fso dbus API. 
    7878    """ 
    79     def __init__(self): 
     79    def __init__(self, mainloop): 
    8080        super(FSODialer, self).__init__() 
    8181        self.callid = None 
     
    8585        from threading import Thread 
    8686        # put the slow init function into background 
    87         Thread(target=self._init).start() 
     87        Thread(target=self._init, args=(mainloop, )).start() 
    8888        # FIXME: get state from fso and set self state 
    8989        self._set_state('release') 
    9090 
    91     def _init(self): 
    92         if not self.fso.initialize(): 
     91    def _init(self, mainloop): 
     92        if not self.fso.initialize(mainloop): 
    9393            return 
    9494        self.fso.onCallStatus.append(self.on_call_status) 
     
    131131 
    132132def _test(): 
    133     import ecore 
    134     FSODialer() 
    135     ecore.main_loop_begin() 
     133    from dbus.mainloop.glib import DBusGMainLoop 
     134    FSODialer(DBusGMainLoop()) 
    136135 
    137136 
  • developers/john_lee/pyfso/fso_backend.py

    r4527 r4536  
    1 import e_dbus 
    21import os 
    32from dbus import DBusException, SystemBus, Interface 
     
    4544        return obj 
    4645 
    47     def initialize( self ): 
     46    def initialize( self, mainloop ): 
    4847        if self.fullinit: 
    4948            return True 
    5049        try: 
    51             self.bus = SystemBus( mainloop=e_dbus.DBusEcoreMainLoop() ) 
     50            self.bus = SystemBus( mainloop=mainloop ) 
    5251        except DBusException, e: 
    5352            print "could not connect to dbus_object system bus:", e 
     
    178177 
    179178def _test(): 
     179    from dbus.mainloop.glib import DBusGMainLoop 
    180180    fso = FSOObject() 
    181     fso.initialize() 
     181    fso.initialize(DBusGMainLoop()) 
    182182 
    183183 
Note: See TracChangeset for help on using the changeset viewer.