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 couchdbkit import Server | |
>>> | |
>>> # server object | |
... server = Server() | |
>>> | |
>>> # create database | |
... db = server.get_or_create_db('foo') | |
>>> db | |
<Database foo> | |
>>> db['bar'] = {'a': 1} |
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
>>> doc = db['foo'] | |
>>> doc | |
{u'a': 1, u'_rev': u'1-23202479633c2b380f79507a776743d5', u'_id': u'foo'} | |
>>> doc.update({'a': 2}) | |
>>> db.save_doc(doc) | |
>>> db['foo'] | |
{u'a': 2, u'_rev': u'2-71173597778497e0a6aa176963f222db', u'_id': u'foo'} |
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
rtmp://p.ep17153.i.akamaientrypoint.net/EntryPoint |
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
rtmp://b.ep17153.i.akamaientrypoint.net/EntryPoint |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
<title>Design Museum Shop: | |
Checkout > | |
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
214c214,219 | |
< self.io_loop.remove_handler(fd) | |
--- | |
> try: | |
> self.io_loop.remove_handler(fd) | |
> except (OSError, IOError), e: | |
> if e[0] != errno.ENOENT: | |
> raise | |
> | |
223c228 |
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
138c138 | |
< except OSError: | |
--- | |
> except (IOError, OSError): | |
196c196 | |
< except OSError, e: | |
--- | |
> except (IOError, OSError), e: |
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 setuptools import setup, find_packages | |
setup( | |
name = 'webapp', | |
install_requires=[ | |
'tornado==0.2', | |
], | |
entry_points = { | |
'console_scripts': [ | |
'doit = webapp:main' |
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
self.write(""" | |
<h1>Hello, %s</h1> | |
<hr /> | |
<form> | |
<input type="text" name="name" /> | |
<input type="submit" /> | |
</form> |
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 flickrapi | |
client = flickrapi.FlickrAPI( | |
config.FLICKR_API_KEY, | |
config.FLICKR_API_SECRET, | |
store_token = False | |
) | |
try: | |
rsp = client.people_getInfo(user_id=flickr_data['user']['nsid'], format='json') | |
data = demjson.decode(rsp[14:-1], encoding='utf8') |