mpdchkpyver.py

来自「fortran并行计算包」· Python 代码 · 共 47 行

PY
47
字号
#!/usr/bin/env python##   (C) 2001 by Argonne National Laboratory.#       See COPYRIGHT in top-level directory.#"""This program is not to be executed from the command line.  It is exec'd by mpdroot to verify the version of python before executinga 'regular' mpd pgm, e.g. mpdallexit."""from sys import version, exitif version[0] == '1' and version[1] == '.':    print "mpdchkpyver: your python version must be >= 2.2 ;"    print "  current version is:", version    exit(-1)##  These must be after 1.x version checkfrom time import ctime__author__ = "Ralph Butler and Rusty Lusk"__date__ = ctime()__version__ = "$Revision: 1.4 $"__credits__ = ""from sys     import argv, exitfrom os      import environ, execvpefrom mpdlib  import mpd_check_python_versionif __name__ == '__main__':    if len(argv) == 1  or  argv[1] == '-h'  or  argv[1] == '--help':        print __doc__	exit(-1)    else:        vinfo = mpd_check_python_version()        if vinfo:            print "mpdchkpyver: your python version must be >= 2.2 ; current version is:", vinfo            exit(-1)        if len(argv) > 1:            mpdpgm = argv[1] + '.py'            # print "CHKPYVER: PGM=:%s: ARGV[1:]=:%s:" % (mpdpgm,argv[1:])            try:                execvpe(mpdpgm,argv[1:],environ)    # client            except Exception, errinfo:                print 'mpdchkpyver: failed to exec %s; info=%s' % (mpdpgm,errinfo)                exit(-1)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?