This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tipfy import RequestHandler | |
from tipfyext.jinja2 import Jinja2Mixin | |
from tipfy.sessions import SessionMiddleware | |
class ChromeFrameMiddleware(object): | |
""" | |
Middleware that enables the Google Chrome frame plugin or IE edge | |
rendering engine. | |
""" | |
def after_dispatch(self, handler, response): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# Copyright (C) 2009 Facebook | |
# Copyright (C) 2010, 2011 Tipfy.org | |
# Copyright (C) 2011 Yesudeep Mangalapilly <yesudeep@gmail.com> | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may | |
# not use this file except in compliance with the License. You may obtain | |
# a copy of the License at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
# Python 3. | |
from urllib.parse import urlparse, urlunparse, parse_qs, quote, unquote_plus | |
except ImportError: | |
# Python 2.5+ | |
from urlparse import urlparse, urlunparse | |
from urllib import quote, unquote_plus | |
try: | |
# Python 2.6+ | |
from urlparse import parse_qs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Authorization in simple words: | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
1. Construct a client with its client credentials. | |
2. Send an HTTP request for temporary credentials with a callback URL | |
which the server will call with an OAuth verification code. | |
3. Parse out temporary credentials from a successful server response. | |
4. Using the temporary credentials build an authorization URL and |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# Copyright (C) 2009 Facebook | |
# Copyright (C) 2010, 2011 Tipfy.org | |
# Copyright (C) 2011 Yesudeep Mangalapilly <yesudeep@gmail.com> | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may | |
# not use this file except in compliance with the License. You may obtain | |
# a copy of the License at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# Copyright (C) 2009 Facebook | |
# Copyright (C) 2010, 2011 Tipfy.org | |
# Copyright (C) 2011 Yesudeep Mangalapilly <yesudeep@gmail.com> | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may | |
# not use this file except in compliance with the License. You may obtain | |
# a copy of the License at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def generate_random_string(bit_strength=64, decimal=False): | |
""" | |
Generates a random ASCII-encoded unsigned integral random number in decimal | |
or hexadecimal representation. | |
:param bit_strength: | |
Bit strength. | |
:returns: | |
A string representation of a randomly-generated ASCII-encoded | |
hexadecimal/decimal-representation unsigned integral number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# Copyright (C) 2009 Facebook | |
# Copyright (C) 2010, 2011 Tipfy.org | |
# Copyright (C) 2011 Yesudeep Mangalapilly <yesudeep@gmail.com> | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may | |
# not use this file except in compliance with the License. You may obtain | |
# a copy of the License at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyoauth.oauth1 import Credentials | |
from pyoauth.oauth1.client import Client | |
client_credentials = Credentials( | |
identifier="CONSUMER KEY", | |
shared_secret="CONSUMER SECRET" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; python-pylint.el --- minor mode for running `pylint' | |
;; Copyright (c) 2009, 2010 Ian Eure <ian.eure@gmail.com> | |
;; Author: Ian Eure <ian.eure@gmail.com> | |
;; Keywords: languages python | |
;; Last edit: 2010-02-12 | |
;; Version: 1.01 |
OlderNewer