@classmethod
def _parse_link(cls, s):
    'Parse a shortlink into its nbhd/project/app/artifact parts'
    s = s.strip()
    if s.startswith('['):
        s = s[1:]
    if s.endswith(']'):
        s = s[:(- 1)]
    parts = s.split(':')
    p_shortname = None
    p_id = None
    p_nbhd = None
    if getattr(c, 'project', None):
        p_shortname = getattr(c.project, 'shortname', None)
        p_id = getattr(c.project, '_id', None)
        p_nbhd = c.project.neighborhood_id
    if (len(parts) == 3):
        p = Project.query.get(shortname=parts[0], neighborhood_id=p_nbhd)
        if p:
            p_id = p._id
        return dict(nbhd=p_nbhd, project=parts[0], project_id=p_id, app=parts[1], artifact=parts[2])
    elif (len(parts) == 2):
        return dict(nbhd=p_nbhd, project=p_shortname, project_id=p_id, app=parts[0], artifact=parts[1])
    elif (len(parts) == 1):
        return dict(nbhd=p_nbhd, project=p_shortname, project_id=p_id, app=None, artifact=parts[0])
    else:
        return None
Parse a shortlink into its nbhd/project/app/artifact parts
@classmethod
def _parse_link(cls, s):
    
    s = s.strip()
    if s.startswith('['):
        s = s[1:]
    if s.endswith(']'):
        s = s[:(- 1)]
    parts = s.split(':')
    p_shortname = None
    p_id = None
    p_nbhd = None
    if getattr(c, 'project', None):
        p_shortname = getattr(c.project, 'shortname', None)
        p_id = getattr(c.project, '_id', None)
        p_nbhd = c.project.neighborhood_id
    if (len(parts) == 3):
        p = Project.query.get(shortname=parts[0], neighborhood_id=p_nbhd)
        if p:
            p_id = p._id
        return dict(nbhd=p_nbhd, project=parts[0], project_id=p_id, app=parts[1], artifact=parts[2])
    elif (len(parts) == 2):
        return dict(nbhd=p_nbhd, project=p_shortname, project_id=p_id, app=parts[0], artifact=parts[1])
    elif (len(parts) == 1):
        return dict(nbhd=p_nbhd, project=p_shortname, project_id=p_id, app=None, artifact=parts[0])
    else:
        return None