Changeset 1428

Show
Ignore:
Timestamp:
11/14/08 14:33:46 (15 years ago)
Author:
arnonym
Message:

Fix #171: Correctly search for python-modules with hierarchy (bla.blub.X). And search for dbus.mainloop.qt...

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/libffado-2.0/SConstruct

    r1421 r1428  
    151151        context.Message( "Checking for the python module '" + module + "' " ) 
    152152        ret = True 
    153         try: 
    154                 imp.find_module( module ) 
    155         except ImportError: 
    156                 ret = False 
     153        path = None 
     154        while module.count(".") > 0 and ret: 
     155                thismod = module.split(".")[0] 
     156                try: 
     157                        modinfo = imp.find_module( thismod, path ) 
     158                except ImportError: 
     159                        ret = False 
     160                else: 
     161                        newmod = imp.load_module( thismod, modinfo[0], modinfo[1], modinfo[2] ) 
     162                        path = newmod.__path__ 
     163                module = ".".join( module.split(".")[1:] ) 
     164        if ret: 
     165                try: 
     166                        imp.find_module( module ) 
     167                except ImportError: 
     168                        ret = False 
    157169        context.Result( ret ) 
    158170        return ret 
     
    276288        # PyQT checks 
    277289        build_mixer = False 
    278         if conf.CheckForApp( "which pyuic4" ) and conf.CheckForPyModule( 'dbus' ) and conf.CheckForPyModule( 'PyQt4' ): 
     290        if conf.CheckForApp( 'which pyuic4' ) and conf.CheckForPyModule( 'dbus' ) and conf.CheckForPyModule( 'PyQt4' ) and conf.CheckForPyModule( 'dbus.mainloop.qt' ): 
    279291                env['PYUIC4'] = True 
    280292                build_mixer = True 
    281293         
    282         if conf.CheckForApp( "which pyuic" ) and conf.CheckForPyModule( 'dbus' ) and conf.CheckForPyModule( 'qt' ): 
     294        if conf.CheckForApp( 'which pyuic' ) and conf.CheckForPyModule( 'dbus' ) and conf.CheckForPyModule( 'qt' ): 
    283295                env['PYUIC'] = True 
    284296                build_mixer = True 
    285297         
    286         if conf.CheckForApp( "xdg-desktop-menu --help" ): 
     298        if conf.CheckForApp( 'xdg-desktop-menu --help' ): 
    287299                env['XDG_TOOLS'] = True 
    288300        else: