'Builds the base signature string.'

def sign(self, request, consumer, token):

    (key, raw) = self.signing_base(request, consumer, token)
    try:
        import hashlib
        hashed = hmac.new(key, raw, hashlib.sha1)
    except ImportError:
        import sha
        hashed = hmac.new(key, raw, sha)
    return binascii.b2a_base64(hashed.digest())[:(-1)]
