def register(apps): from piko import App app = App('piko.oauth', template_folder=template_path) app.debug = True register_routes(app) apps['/oauth'] = app return apps
def register(apps): app = App('piko.busby', template_folder = template_path) app.debug = True register_routes(app) apps['/busby'] = app return apps
def register(apps): """ Register the application """ app = App('piko.pki', template_folder=TEMPLATE_PATH) app.debug = True register_routes(app) apps['/pki'] = app return apps
def register(apps): """ Register candlepin as a Flask application. """ app = App('piko.candlepin', template_folder=template_path) register_routes(app) apps['/candlepin'] = app api_app = App('piko.candlepin') api_app.debug = True register_api_routes(api_app) apps['/api/v1/candlepin'] = api_app return apps
def register(apps): """ Register home as a Flask application. :param apps: A list of :py:class:`piko.App` applications. :type apps: list :returns: A list of :py:class:`piko.App` applications with this application included. """ app = App('piko', template_folder=template_path) app.debug = True register_routes(app) apps['/'] = app return apps
def register(apps): """ Register the knowledgebase as a Flask application. """ app = App('piko.kb', template_folder=template_path) register_routes(app) apps['/kb'] = app return apps
# coding: utf-8 import os from flask import Flask from flask import session from flask.ext.oauthlib.client import OAuth from piko import App app = App('piko') oauth = OAuth(app) def twitter(): if app.config.get('TWITTER_API_KEY', False): twitter = oauth.remote_app( 'twitter', register=False, consumer_key=app.config.get('TWITTER_API_KEY', None), consumer_secret=app.config.get('TWITTER_API_SECRET', None), base_url='https://api.twitter.com/1.1/', request_token_url='https://api.twitter.com/oauth/request_token', access_token_url='https://api.twitter.com/oauth/access_token', authorize_url='https://api.twitter.com/oauth/authenticate', ) @twitter.tokengetter def get_twitter_token(): if 'twitter_oauth' in session: resp = session['twitter_oauth_token']