def _login(self): title("LOGIN") print "Logging into Funnel..." self.browser.open(URI['login']) self.browser.select_form(nr=1) form = self.browser.form form['username'] = config.get('FUNNEL_USERNAME', None) or raw_input('Please enter your registered Funnel username: '******'password'] = config.get('FUNNEL_PASSWORD', None) or getpass.getpass('Please enter your Funnel password: '******'lastuser_login']: print "The credentials you provided are incorrect..." sys.exit(1) else: print "Successfully logged into Funnel..."
def _login(self): title("LOGIN") print "Logging into DoAttend..." self.browser.open(URI['login']) self.browser.select_form(nr=0) form = self.browser.form form['account[email]'] = config.get('DOATTEND_EMAIL', None) or raw_input('Please enter your registered DoAttend email address: ') form['account[password]'] = config.get('DOATTEND_PASS', None) or getpass.getpass('Please enter your DoAttend password: '******'login']: print "The credentials you provided are incorrect..." sys.exit(1) else: print "Successfully logged into DoAttend..."
from mechanize import ParseResponse, urlopen, urljoin, LinkNotFoundError, ItemNotFoundError from instance import config from .mechanizer import Mechanizer import getpass import simplejson as json import sys from helpers import title base_uri = config.get('FUNNEL_URL', 'https://funnel.hasgeek.com/') base_lastuser_uri = config.get('LASTUSER_URL', 'https://auth.hasgeek.com/') URI = dict( login=urljoin(base_uri, 'login'), lastuser_login=urljoin(base_lastuser_uri, 'login'), proposal_json=urljoin(base_uri, '{space}/json')) class Funnel(Mechanizer): def __init__(self, browser=None): super(Funnel, self).__init__(browser) self._login() def _login(self): title("LOGIN") print "Logging into Funnel..." self.browser.open(URI['login']) self.browser.select_form(nr=1) form = self.browser.form form['username'] = config.get('FUNNEL_USERNAME', None) or raw_input('Please enter your registered Funnel username: '******'password'] = config.get('FUNNEL_PASSWORD', None) or getpass.getpass('Please enter your Funnel password: '******'lastuser_login']: print "The credentials you provided are incorrect..."
def init_app(self, app): self.app = app config = app.config.copy() self.appkey = config.get('APP_KEY') self.mastersecret = config.get('MASTER_SECRET') self.appid = config.get('APP_ID')