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
Traceback (most recent call last): | |
File "/opt/doula/lib/python2.6/site-packages/waitress/channel.py", line 329, in service | |
task.service() | |
File "/opt/doula/lib/python2.6/site-packages/waitress/task.py", line 173, in service | |
self.execute() | |
File "/opt/doula/lib/python2.6/site-packages/waitress/task.py", line 380, in execute | |
app_iter = self.channel.server.application(env, start_response) | |
File "/opt/doula/lib/python2.6/site-packages/pyramid/router.py", line 187, in __call__ | |
response = self.handle_request(request) | |
File "/opt/doula/lib/python2.6/site-packages/pyramid/tweens.py", line 20, in excview_tween |
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
#tests | |
import unittest | |
from mock import patch | |
from pyramid import testing | |
from pyramid.httpexceptions import HTTPFound | |
from pyramid.httpexceptions import HTTPForbidden | |
from clusterflunk.views import login | |
from clusterflunk.views import login_complete | |
from clusterflunk.views import login_denied |
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
import unittest | |
from clusterflunk.request import ClusterflunkRequest | |
class TestRequest(unittest.TestCase): | |
def test_db(self): | |
request = ClusterflunkRequest({}) | |
db = request.db | |
self.assertTrue(hasattr(db, 'add')) |
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 update(p, attrs): | |
""" | |
Updates a specific "Job" dict, must be given an id | |
""" | |
k = keys() | |
job_dict = pop_job(default_queue_name, attrs['id']) | |
# sometimes the job_dict comes back as None, why? | |
if 'id' in attrs: | |
job_dict = pop_job(p, attrs['id']) | |
else: |
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
session="754d4d3eff449c74aba14fab513ccd0dc45ee521gAJKmf78T0dB0/8/aNZ2Pn1xAShVEHR3aXR0ZXJfdXNlcm5hbWVxAlUHX2pheWQzZXEDVQthdXRoLnVzZXJpZHEESwNVBXRva2VucQVVkm9hdXRoX3Rva2VuPUtkMmJ1bzJGemJzWUw3NWI5akpaZG1kRUNtbnRIVlRjWnc5ZEZLaGlYbyZvYXV0aF90b2tlbl9zZWNyZXQ9c2FFUTZ2N2tZRTJGc0VsZFY0WEVIaWRSUnBnRkxBMXBSS0VLU1VDaU1vJm9hdXRoX2NhbGxiYWNrX2NvbmZpcm1lZD10cnVlcQZVF3R3aXR0ZXJfYWNjb3VudF91c2VyX2lkcQdVCTIzMzczMzY0NXEIVSF0d2l0dGVyX29hdXRoX2FjY2Vzc190b2tlbl9zZWNyZXRxCVUqSVZzU2R4cUswWERlZEZieEpIZ2VMeGcxYkJBVmFvNmdGTG1LWTZkMTN3cQp1h3ELLg\075\075" |
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 hashlib import sha1 | |
# This is what we sign our values with | |
secret = '2q3j4q23ruas9fu28qu3rjsfia9uq23' | |
# This is the hash that we are going to pass to our user's e-mail | |
sent_hash = sha1() | |
sent_hash.update(os.urandom(60)) | |
signature = sha1() |
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
secret = 'dfkasdfiq983ruasfn3rwd9fas' | |
# This is the hash that we are going to pass to our user's e-mail | |
stored_hash = sha1() | |
stored_hash.update(os.urandom(60)) | |
sent_hash = signed_serialize(stored_hash.hexdigest(), secret) | |
# Store stored_hash off into the db | |
# Send this to our user's e-mail |
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
import os, shutil, csv | |
from xml.dom import minidom | |
from xml.etree import ElementTree as ET | |
from jinja2 import Template, Environment, PackageLoader | |
env = Environment(loader=PackageLoader('main', 'templates')) | |
template = env.get_template('template.html') | |
fileList = os.listdir('./data') | |
def get_XML_Files(fileList): | |
for f in fileList: |
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
import requests | |
from pyramid.config import Configurator | |
from pyramid.view import view_config | |
@view_config(route_name='login', renderer='myapp:templates/login.mako') | |
def login(request): | |
return {} | |
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
import requests | |
from flask import ( | |
Flask, | |
render_template, | |
request | |
) | |
from velruse.app import make_velruse_app | |
from werkzeug.wsgi import DispatcherMiddleware |