Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
1,240 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env python | ||
from setuptools import setup | ||
|
||
setup( | ||
name="bunny1", | ||
version="1.0", | ||
description="bunny1 is a tool that lets you write smart bookmarks in " + | ||
"python and then share them across all your browsers and with a " + | ||
"group of people or the whole world.", | ||
author="facebook", | ||
author_email="bunny1-feedback@lists.facebook.com", | ||
url="http://www.bunny1.org/", | ||
packages=["bunny1"], | ||
package_dir={"bunny1": "src"}, | ||
package_data={"bunny1": ["README", "LICENSE", "*.gif", "*.ico"]}, | ||
scripts=["src/b1_example.py", "src/b1_barebones.py"], | ||
install_requires=["cherrypy>=3.1.0"], | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Copyright (c) 2007-2009, Facebook Inc. | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
* Neither the name of Facebook, inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
bunny1 | ||
|
||
Copyright (c) 2007-2009, Facebook Inc. | ||
|
||
bunny1 is a tool that lets you write smart bookmarks in python and then | ||
share them across all your browsers and with a group of people or the | ||
whole world. It was developed at Facebook and is widely used there. | ||
|
||
To install bunny1, run | ||
sudo setup.py build install | ||
|
||
To get started, run the example.py script that will be under | ||
build/scripts-<version>/ | ||
./example.py | ||
|
||
If you need to change the port that the server is running on (the default is | ||
9084), then you can use the --port option, ex. | ||
./example .py --port=8080 | ||
|
||
You can see other command-line options by running ./example.py --help | ||
|
||
The server should then tell you where it is running. If you visit that URL, | ||
you should see a help page for bunny1 that explains how to configure your | ||
browser to work with the server. | ||
|
||
If it isn't easy to run a standalone server in your environment | ||
(ex. DreamHost or most other shared hosting environments), then you can | ||
just use example.py or barebones.py or a similar script as a CGI. | ||
|
||
To setup your own commands, the easiest way to start is by taking either the | ||
example.py script or the barebones.py script and editing it. example.py | ||
includes a bunch of examples of the different kinds of things you can do, | ||
and is a good place to start reading if you're interested in what special | ||
features are available. If you just want something simple to get started, | ||
the barebones.py script is the most stripped-down and straightforward, and | ||
it works well if you want to just copy something and modify it to make your | ||
own server. | ||
|
||
bunny1 requires CherryPy 3.1.0 or newer and python2.4 or python2.5. | ||
bunny1 does not currently work with python2.6. | ||
|
||
The original author of bunny1 is Charlie Cheever. David Reiss and | ||
Dan Corson and Will Chen and Chris Piro and Eugene Letuchy and Luke Shepard | ||
and others contributed ideas and code and support. Julie Zhuo made the | ||
blob bunny logo. | ||
|
||
The original idea for bunny1 came from yubnub.org. Ubiquity from | ||
Mozilla Labs is a similar tool that is very powerful and worth checking | ||
out if you are a Firefox user. | ||
|
||
You can send feedback and bug reports to bunny1-feedback@lists.facebook.com . | ||
|
||
-- ccheever | ||
|
||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from bunny1 import * |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/python | ||
|
||
__author__ = "ccheever" | ||
__doc__ = """ | ||
A barebones bunny1 server that should be easy to modify for your own use | ||
""" | ||
__date__ = "Thu Feb 12 09:05:40 PST 2009" | ||
|
||
import urlparse | ||
|
||
import bunny1 | ||
from bunny1 import cherrypy | ||
from bunny1 import Content | ||
from bunny1 import q | ||
from bunny1 import qp | ||
from bunny1 import expose | ||
from bunny1 import dont_expose | ||
from bunny1 import escape | ||
from bunny1 import HTML | ||
|
||
class MyCommands(bunny1.Bunny1Commands): | ||
|
||
def your_command_here(self, arg): | ||
"""this is where a description of your command goes""" | ||
return "http://www.example.com/?" % qp(arg) | ||
|
||
def another_command(self, arg): | ||
"""this example will send content to the browser rather than redirecting""" | ||
raise HTML("some <u>html</u> " + escape("with some <angle brackets>")) | ||
|
||
|
||
# ... and you can add other commands by just defining more methods | ||
# in this class here | ||
|
||
class MyBunny(bunny1.Bunny1): | ||
def __init__(self): | ||
bunny1.Bunny1.__init__(self, MyCommands(), bunny1.Bunny1Decorators()) | ||
|
||
if __name__ == "__main__": | ||
bunny1.main(MyBunny()) | ||
|
||
|
Oops, something went wrong.