コード例 #1
0
ファイル: SSH.py プロジェクト: antonelloceravola/ToolBOSCore
def guessRemoteAccessIsPossible():
    """
        Returns True if it is apparently possible that SSH authorized keys
        are configured, hence login to remote machines likely is possible.
    """
    authorizedKeysFile = os.path.expanduser( '~/.ssh/authorized_keys' )

    return Any.isFileNonEmpty( authorizedKeysFile )
コード例 #2
0
def _getCompilers( platform ):
    """
        Get currently used C and C++ compilers.
    """
    from ToolBOSCore.Util.FastScript import getFileContent

    compilersTxtPath = 'build/{}/compilers.txt'.format( platform )

    if Any.isFile( compilersTxtPath ) and Any.isFileNonEmpty( compilersTxtPath ):
        content                = getFileContent( compilersTxtPath )
        cCompiler, cxxCompiler = content.split( '::' )

        return { 'c': cCompiler.strip( ), 'c++': cxxCompiler.strip( ) }
    else:
        return None