예제 #1
0
def is_valid_description(entry):
    """
    If the entry starts with a valid jira ticket
    :param entry:
    :return:
    """
    try:
        description = entry['description']
    except KeyError:
        return error(entry, 'Missing description')
    if re.match(r'[A-Z]+-[\d]+', description):
        return success(entry)
    return error(entry, 'Invalid description')
예제 #2
0
파일: clean.py 프로젝트: pnw/jiggl
def is_valid_description(entry):
    """
    If the entry starts with a valid jira ticket
    :param entry:
    :return:
    """
    try:
        description = entry['description']
    except KeyError:
        return error(entry, 'Missing description')
    if re.match(r'[A-Z]+-[\d]+', description):
        return success(entry)
    return error(entry, 'Invalid description')
예제 #3
0
파일: clean.py 프로젝트: pnw/jiggl
def has_significant_duration(entry):
    """
    If a duration is too small, then jira doesn't like it. Plus, there's no reason to log it...
    :param entry:
    :return:
    """
    duration = entry['duration']
    if duration < 60 * 5:
        return error(entry, 'Duration is too small: %s seconds' % duration)
    return success(entry)
예제 #4
0
def has_significant_duration(entry):
    """
    If a duration is too small, then jira doesn't like it. Plus, there's no reason to log it...
    :param entry:
    :return:
    """
    duration = entry['duration']
    if duration < 60 * 5:
        return error(entry, 'Duration is too small: %s seconds' % duration)
    return success(entry)
예제 #5
0
파일: clean.py 프로젝트: pnw/jiggl
def is_not_currently_logging(entry):
    if entry['duration'] < 0:
        return error(entry, 'Currently logging')
    return success(entry)
예제 #6
0
파일: clean.py 프로젝트: pnw/jiggl
def is_not_already_logged(entry):
    if JIGGLD_TAG in entry.get('tags', []):
        return error(entry, 'Already logged')
    return success(entry)
예제 #7
0
def is_not_currently_logging(entry):
    if entry['duration'] < 0:
        return error(entry, 'Currently logging')
    return success(entry)
예제 #8
0
def is_not_already_logged(entry):
    if JIGGLD_TAG in entry.get('tags', []):
        return error(entry, 'Already logged')
    return success(entry)