示例#1
0
def fingerprint_not_found(request, fingerprint):
    """Displays the fingerprint not found page when a user follows a link for 
    more info in the 'fingerprint not found' validation error. This error is 
    displayed on the subscribe form if the user tries to subscribe to a node 
    that isn't in our database.

    @type fingerprint: str
    @param fingerprint: The fingerprint the user entered in the subscribe form.
    """
    # get the template
    template = templates.fingerprint_not_found

    #display the page
    return render_to_response(template, {'fingerprint' :
        insert_fingerprint_spaces(fingerprint)})
示例#2
0
def fingerprint_not_found(request, fingerprint):
    """Displays the fingerprint not found page when a user follows a link for 
    more info in the 'fingerprint not found' validation error. This error is 
    displayed on the subscribe form if the user tries to subscribe to a node 
    that isn't in our database.

    @type fingerprint: str
    @param fingerprint: The fingerprint the user entered in the subscribe form.
    """
    # get the template
    template = templates.fingerprint_not_found

    #display the page
    return render_to_response(template, {'fingerprint' :
        insert_fingerprint_spaces(fingerprint)})
示例#3
0
def _get_router_name(fingerprint, name):
    """Returns a string representation of the name and fingerprint of
    this router. Ex: 'WesCSTor (id: 4094 8034 ...)'
    
    @type fingerprint: str
    @param fingerprint: A router fingerprint
    @type name: str
    @param name: A router name

    @rtype: str
    @return: An email-friendly string representation of the name and
    fingerprint. Only returns a representation of the fingerprint 
    C{if name == 'Unnamed'}.
    """

    spaced_fingerprint = insert_fingerprint_spaces(fingerprint) 
    if name == 'Unnamed':
        return "(id: %s)" % spaced_fingerprint
    else:
        return "%s (id: %s)" % (name, spaced_fingerprint)
示例#4
0
def _get_router_name(fingerprint, name):
    """Returns a string representation of the name and fingerprint of
    this router. Ex: 'WesCSTor (id: 4094 8034 ...)'
    
    @type fingerprint: str
    @param fingerprint: A router fingerprint
    @type name: str
    @param name: A router name

    @rtype: str
    @return: An email-friendly string representation of the name and
    fingerprint. Only returns a representation of the fingerprint 
    C{if name == 'Unnamed'}.
    """

    spaced_fingerprint = insert_fingerprint_spaces(fingerprint)
    if name == 'Unnamed':
        return "(id: %s)" % spaced_fingerprint
    else:
        return "%s (id: %s)" % (name, spaced_fingerprint)