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