示例#1
0
文件: cmd.py 项目: zerothi/sisl
def argv_negative_fix(argv):
    """ Fixes the `argv` list by adding a space for input that may be float's """
    rgv = []
    for a in argv:
        try:
            strseq(complex, a)
            strmap(complex, a)
        except:
            rgv.append(a)
        else:
            rgv.append(' ' + a)
    return rgv
示例#2
0
def argv_negative_fix(argv):
    """ Fixes the `argv` list by adding a space for input that may be float's """
    rgv = []
    for a in argv:
        try:
            strseq(complex, a)
            strmap(complex, a)
        except:
            rgv.append(a)
        else:
            rgv.append(' ' + a)
    return rgv
示例#3
0
def argv_negative_fix(argv):
    """ Fixes `argv` list by adding a space for input that may be float's

    This function tries to prevent ``'-<>'`` being captured by `argparse`.

    Parameters
    ----------
    argv : list of str
       the arguments passed to an argument-parser
    """
    rgv = []
    for a in argv:
        try:
            strseq(complex, a)
            strmap(complex, a)
        except:
            rgv.append(a)
        else:
            rgv.append(' ' + a)
    return rgv