resource.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:core-framework 作者: RedhawkSDR 项目源码 文件源码
def _getOptions(classtype):
    try:
        # IMPORTANT YOU CANNOT USE gnu_getopt OR OptionParser
        # because they will treat execparams with negative number
        # values as arguments.
        #
        # Since property ids *MUST* be valid XML names
        # they cannot start with -, therefore this is safe
        opts, args = getopt.getopt(sys.argv[1:], "i", ["interactive"])
        if len(opts)==0 and len(args)==0:
            print "usage: %s [options] [execparams]" % sys.argv[0]
            print
            print "The set of execparams is defined in the .prf for the component"
            print "They are provided as arguments pairs ID VALUE, for example:"
            print "     %s INT_PARAM 5 STR_PARAM ABCDED" % sys.argv[0]
            print
            print classtype.__doc__
            sys.exit(2)
    except getopt.GetoptError:
        print "usage: %s [options] [execparams]" % sys.argv[0]
        print
        print "The set of execparams is defined in the .prf for the component"
        print "They are provided as arguments pairs ID VALUE, for example:"
        print "     %s INT_PARAM 5 STR_PARAM ABCDED" % sys.argv[0]
        print
        print classtype.__doc__
        sys.exit(2)
    return opts, args
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号