Example #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')
Example #2
0
File: clean.py Project: 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')
Example #3
0
File: clean.py Project: 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)
Example #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)
Example #5
0
File: clean.py Project: pnw/jiggl
def is_not_currently_logging(entry):
    if entry['duration'] < 0:
        return error(entry, 'Currently logging')
    return success(entry)
Example #6
0
File: clean.py Project: pnw/jiggl
def is_not_already_logged(entry):
    if JIGGLD_TAG in entry.get('tags', []):
        return error(entry, 'Already logged')
    return success(entry)
Example #7
0
def is_not_currently_logging(entry):
    if entry['duration'] < 0:
        return error(entry, 'Currently logging')
    return success(entry)
Example #8
0
def is_not_already_logged(entry):
    if JIGGLD_TAG in entry.get('tags', []):
        return error(entry, 'Already logged')
    return success(entry)