Did I find the right examples for you? yes no

All Samples(27)  |  Call(27)  |  Derive(0)  |  Import(0)
Tries to determine the libc version that the file executable
(which defaults to the Python interpreter) is linked against.

Returns a tuple of strings (lib,version) which default to the
given parameters in case the lookup fails.

Note that the function has intimate knowledge of how different
libc versions add symbols to the executable and thus is probably
only useable for executables compiled using gcc.
(more...)

        def libc_ver(executable=sys.executable,lib='',version='',

             chunksize=2048):

    """ Tries to determine the libc version that the file executable
        (which defaults to the Python interpreter) is linked against.

        Returns a tuple of strings (lib,version) which default to the
        given parameters in case the lookup fails.

        Note that the function has intimate knowledge of how different
        libc versions add symbols to the executable and thus is probably
        only useable for executables compiled using gcc.

        The file is read and scanned in chunks of chunksize bytes.

    """
    if hasattr(os.path, 'realpath'):
        # Python 2.2 introduced os.path.realpath(); it is used
        # here to work around problems with Cygwin not being
        # able to open symlinks for reading
        executable = os.path.realpath(executable)
    f = open(executable,'rb')
    binary = f.read(chunksize)
    pos = 0
    while 1:
        m = _libc_search.search(binary,pos)
        if not m:
            binary = f.read(chunksize)
            if not binary:
                break
            pos = 0
            continue
        libcinit,glibc,glibcversion,so,threads,soversion = m.groups()
        if libcinit and not lib:
            lib = 'libc'
        elif glibc:
            if lib != 'glibc':
                lib = 'glibc'
                version = glibcversion
            elif glibcversion > version:
                version = glibcversion
        elif so:
            if lib != 'glibc':
                lib = 'libc'
                if soversion and soversion > version:
                    version = soversion
                if threads and version[-len(threads):] != threads:
                    version = version + threads
        pos = m.end()
    f.close()
    return lib,version
        


src/b/e/BeginningPythonExercises-HEAD/other/system_admin/PULSA/pythonForSystemAdmin/src/example_8_1.py   BeginningPythonExercises(Download)
platform.architecture(),
platform.dist(),
platform.libc_ver(),
platform.mac_ver(),
platform.machine(),

src/r/e/RedJack-0.3.0/redjack/agent.py   RedJack(Download)
        caps['arch'] = platform.architecture()[0]
        caps['system'] = platform.system()
        caps['libc'] = "-".join(platform.libc_ver())
        caps['machine'] = platform.machine()
        caps['node'] = platform.node()

src/g/r/GraphLab-Create-0.2.0/graphlab_util/metric_tracker.py   GraphLab-Create(Download)
    if self._sys_info['system'] == 'Linux':
      self._sys_info['os_version'] = self._tup_to_flat_str(platform.linux_distribution())
      self._sys_info['libc_version'] = self._tup_to_flat_str(platform.libc_ver())
    elif self._sys_info['system'] == 'Darwin':
      self._sys_info['os_version'] = self._tup_to_flat_str(platform.mac_ver())

src/g/s/gsdview-HEAD/gsdview/utils.py   gsdview(Download)
        'platform: %s' % platform.platform(),
    ]
    libc_ver = '%s %s\n' % platform.libc_ver()
    if libc_ver.strip():
        platform_info.append(libc_ver)

src/p/y/pymssql-2.1.0/setup.py   pymssql(Download)
print("setup.py: platform.architecture() => %r" % (platform.architecture(),))
print("setup.py: platform.linux_distribution() => %r" % (platform.linux_distribution(),))
print("setup.py: platform.libc_ver() => %r" % (platform.libc_ver(),))
 
# 32 bit or 64 bit system?

src/p/y/pymssql-HEAD/setup.py   pymssql(Download)
print("setup.py: platform.architecture() => %r" % (platform.architecture(),))
print("setup.py: platform.linux_distribution() => %r" % (platform.linux_distribution(),))
print("setup.py: platform.libc_ver() => %r" % (platform.libc_ver(),))
 
# 32 bit or 64 bit system?

src/o/p/openvault-core-HEAD/hydra-jetty/webapps/media/WEB-INF/lib/Lib/test/test_platform.py   openvault-core(Download)
            # Cygwin horror
            executable = executable + '.exe'
        res = platform.libc_ver(executable)
 
def test_main():

src/p/l/plexnet-HEAD/third_party/generic/pypy/lib-python/2.5.2/test/test_platform.py   plexnet(Download)
            # Cygwin horror
            executable = executable + '.exe'
        res = platform.libc_ver(executable)
 
def test_main():

src/f/i/Field-HEAD/Contents/lib/python/test/test_platform.py   Field(Download)
            # Cygwin horror
            executable = executable + '.exe'
        res = platform.libc_ver(executable)
 
def test_main():

src/b/a/babble-HEAD/include/jython/Lib/test/test_platform.py   babble(Download)
            # Cygwin horror
            executable = executable + '.exe'
        res = platform.libc_ver(executable)
 
def test_main():

  1 | 2 | 3  Next