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
{ | |
"_rev": "1-262566171", | |
"_id": "_design/type_edition", | |
"language": "javascript", | |
"views": { | |
"by_title": { | |
"map": "function(doc) { if (doc.type.key == '/type/edition' && doc.title) emit(doc.title, doc.key);}" | |
}, | |
"by_isbn_10": { | |
"map": "function(doc) { if (doc.type.key == '/type/edition' && doc.isbn_10) for (var i in doc.isbn_10) emit(doc.isbn_10[i], doc.key);}" |
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
[infogami] | |
infogami_server = "http://ia331526:7070" | |
smtp_server = "mail.archive.org" | |
secret_key = "xxx" | |
plugins = ["openlibrary", "search", "scod", "recaptcha", "akismet", "i18n"] | |
python_path = ["/0/pharos/code/openlibrary/pharos"] | |
[plugin_search] | |
solr_server_address = "pharosdb-bu.us.archive.org:7983" | |
solr_fulltext_address = "ia301443:7983" |
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
"""web frontend for fastcgi process. | |
Usage: | |
python fcgi_server.py socket-file | |
""" | |
from web.wsgiserver import CherryPyWSGIServer | |
from flup.client.fcgi_app import FCGIApp | |
server_address = ("0.0.0.0", 8080) |
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
"""Utility to iterate over couchdb view result.""" | |
import urllib | |
import simplejson | |
class Result: | |
def __init__(self, total_rows, offset, data): | |
self.total_rows = total_rows | |
self.offset = offset | |
self._data = data |
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 f(x): | |
def g(y): | |
fail | |
return g | |
def format_tb(tb): | |
# this should get value of x | |
f1 = f(1) | |
try: |
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 re | |
class SubDomainApp: | |
"""WSGI application to delegate requests based on domain name. | |
""" | |
def __init__(self, mapping): | |
self.mapping = mapping | |
def __call__(self, environ, start_response): | |
host = environ.get("HTTP_HOST", "") |
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 node | |
var carrier = require('carrier'); | |
var stdin = process.openStdin(); | |
stdin.setEncoding('utf8'); | |
carrier.carry(stdin, function(line) { | |
var body = JSON.parse(line); | |
eval(process.argv[2]); |
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 node | |
// Sample usage: | |
// | |
// $ curl -s 'http://127.0.0.1:15984/seeds/_all_docs?limit=10&include_docs=true' | coucheval.js 'console.log(JSON.stringify(row.doc));' | |
// | |
var carrier = require('carrier'); | |
var stdin = process.openStdin(); |
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 couchdb | |
view = { | |
"_id": "_design/seeds", | |
"fulltext": { | |
"by_seed": { | |
"index": """function(doc) { | |
if (doc.seeds) { | |
var d = new Document(); | |
for (var i=0; i<doc.seeds.length; i++) { |
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
# key has_subject in_solr in_couch | |
/works/OL7714039W True False True | |
/works/OL7714035W True False True | |
/works/OL10612120W True False True | |
/works/OL7713011W True False True | |
/works/OL7713015W True False True | |
/works/OL36429W True False True | |
/works/OL9365418W False True False | |
/works/OL13571022W False True False | |
/works/OL5264422W False True False |
OlderNewer