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 bottle import Bottle, template, request, run | |
app = Bottle() | |
@app.route('/hello/') | |
def greet(): | |
return template(''' | |
<html> | |
<body> | |
Please introduce yourself: |
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
# crochet allows non-twisted apps to call twisted code | |
import crochet | |
crochet.no_setup() | |
from twisted.application import internet, service | |
from twisted.web import server, wsgi, static, resource | |
from twisted.internet import reactor | |
from twisted.python import threadpool | |
# boilerplate to get any WSGI app running under twisted |
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 crochet | |
crochet.setup() | |
from twisted.web import resource, server | |
import random | |
from datetime import datetime | |
import json | |
def _format_sse(msg, event=None): |
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
<html> | |
<head> | |
<script type="text/javascript"> | |
var evtSource = new EventSource("/sse"); | |
evtSource.onmessage = function(e) { | |
// onmessage is the generic handler | |
var eventList = document.getElementById("eventlist"); | |
var newElement = document.createElement("li"); | |
newElement.innerHTML = "message: " + e.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 test(): | |
pass | |
print 'edited from home' |
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
url = http://www.example.com/trunk/projects/1234-Project/Production | |
fetch = trunk:refs/remotes/trunk | |
branches = branches/*:refs/remotes/* | |
tags = tags/*:refs/remotes/tags/* |
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
[svn-remote "svn"] | |
url = http://www.example.com/trunk/projects/1234-project/Production | |
fetch = trunk:refs/remotes/trunk | |
branches = trunk/projects/1234-project/Production/branches/*:refs/remotes/* | |
tags = trunk/projects/1234-project/Production/tags/*:refs/remotes/tags/* |
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
SERVER = "localhost" | |
FROM = "sender@example.com" | |
TO = ["user@example.com"] # must be a list | |
SUBJECT = "Hello!" | |
TEXT = "This message was sent with Python's smtplib." | |
message = """\ |
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/local/bin/pip run on Fri Oct 2 16:22:14 2009 | |
Exception: | |
Traceback (most recent call last): | |
File "/Library/Python/2.5/site-packages/pip-0.4-py2.5.egg/pip.py", line 274, in main | |
self.run(options, args) | |
File "/Library/Python/2.5/site-packages/pip-0.4-py2.5.egg/pip.py", line 431, in run | |
requirement_set.install_files(finder, force_root_egg_info=self.bundle) | |
File "/Library/Python/2.5/site-packages/pip-0.4-py2.5.egg/pip.py", line 1784, in install_files | |
if req_to_install.check_if_exists(): | |
File "/Library/Python/2.5/site-packages/pip-0.4-py2.5.egg/pip.py", line 1641, in check_if_exists |
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 twisted.web.resource import Resource | |
from twisted.web.static import File | |
from twisted.web.proxy import ReverseProxyResource | |
from twisted.web.server import Site | |
from twisted.internet import reactor | |
from imageserver import ModuleImage | |
from settings import settings |
OlderNewer