コード例 #1
0
ファイル: iddgaps.py プロジェクト: Mr-HYP/jEPlus-1
def repeatingfieldsnames(fields):
    """get the names of the repeating fields"""
    fnames = [field['field'][0] for field in fields]
    fnames = [bunchhelpers.onlylegalchar(fname) for fname in fnames]
    fnames = [fname for fname in fnames if bunchhelpers.intinlist(fname.split())]
    fnames = [(bunchhelpers.replaceint(fname), None) for fname in fnames]
    dct = dict(fnames)
    repnames = fnames[:len(list(dct.keys()))]
    return repnames
コード例 #2
0
ファイル: iddgaps.py プロジェクト: santoshphilip/eppy
def repeatingfieldsnames(fields):
    """get the names of the repeating fields"""
    fnames = [field['field'][0] for field in fields]
    fnames = [bunchhelpers.onlylegalchar(fname) for fname in fnames]
    fnames = [fname for fname in fnames if bunchhelpers.intinlist(fname.split())]
    fnames = [(bunchhelpers.replaceint(fname), None) for fname in fnames]
    dct = dict(fnames)
    repnames = fnames[:len(list(dct.keys()))]
    return repnames
コード例 #3
0
ファイル: test_bunchhelpers.py プロジェクト: JasonGlazer/eppy
def testintinlist():
    """pytest for intinlist"""
    data = (('this is', False), # lst, hasint
        ('this is 1', True), # lst, hasint
        ('this 54 is ', True), # lst, hasint
    )
    for lst, hasint in data:
        result = bunchhelpers.intinlist(lst)
        assert result == hasint
コード例 #4
0
def testintinlist():
    """pytest for intinlist"""
    data = (
        ('this is', False),  # lst, hasint
        ('this is 1', True),  # lst, hasint
        ('this 54 is ', True),  # lst, hasint
    )
    for lst, hasint in data:
        result = bunchhelpers.intinlist(lst)
        assert result == hasint