Skip to content

Commit

Permalink
Automated merge with http://hg.mozilla.org/labs/bespin
Browse files Browse the repository at this point in the history
  • Loading branch information
bespin authored and shoe committed Mar 6, 2009
1 parent 5a71e36 commit 0385327
Show file tree
Hide file tree
Showing 37 changed files with 990 additions and 357 deletions.
3 changes: 3 additions & 0 deletions .hgtags
@@ -1,2 +1,5 @@
30b7a1db05072c555ec7930ae6a84c1f31f26ae3 0.1.3
4f73e9e89e81e3f8a3c1ecf28e5e04d0bf63eeb5 0.1.3
78adea9fb4b7e33df220817a48a13fab36258861 0.1.4
d44a4512c0022bae23a36a3d3a5ac4a701f41156 0.1.5
1fcf4e024671c5c62caed100ac8f788a90eb2886 0.1.6
21 changes: 14 additions & 7 deletions README.txt
Expand Up @@ -7,7 +7,6 @@ editor using HTML 5 technology.
Project home page: http://labs.mozilla.com/projects/bespin/
Live system: https://bespin.mozilla.com/


Thanks for downloading the code to the Bespin project. You can easily get
Bespin's Python server running on your local Mac or Linux machine (see note
about Windows below).
Expand Down Expand Up @@ -48,15 +47,21 @@ You can run the unit tests by running::
Updating the Required Files
---------------------------

If the "requirements.txt" file changes, you can re-install the required packages
by running::
If the "requirements.txt" file changes, you can re-install the
required packages by running::

paver required

You can also force upgrade all of the packages like so::

pip install -U -r requirements.txt

More Documentation
------------------

Documentation for Bespin's code and APIs are actually part of every
instance of the Bespin server. To view the docs on your local instance, just
browse to http://127.0.0.1:8080/docs/.

Contributing to Bespin
----------------------
Expand All @@ -67,12 +72,14 @@ For details see:
The source repository is in Mercurial at:
http://hg.mozilla.org/labs/bespin/


Note about running on Windows
-----------------------------

The current, up-to-date Bespin backend is written in Python. Because Python is cross-platform, it should be possible (and likely not too difficult) to make the backend work on Windows once Python 2.5 is installed. However, this has not been tested and there are likely two issues:
The current, up-to-date Bespin backend is written in Python. Because
Python is cross-platform, it should be possible (and likely not too
difficult) to make the backend work on Windows once Python 2.5 is
installed. However, this has not been tested and there are likely two
issues:

1. some libraries used by Bespin try to compile C code
2. some paths may not be correct on Windows systems

2. some paths may not be correct on Windows systems
2 changes: 1 addition & 1 deletion backend/python/bespin/__init__.py
Expand Up @@ -28,6 +28,6 @@

# BEGIN VERSION BLOCK
VERSION = 'tip'
VERSION_NAME = '(none)'
VERSION_NAME = 'DEVELOPMENT MODE'
API_VERSION = 'dev'
# END VERSION BLOCK
7 changes: 6 additions & 1 deletion backend/python/bespin/controllers.py
Expand Up @@ -344,12 +344,17 @@ def _perform_import(file_manager, user, project_name, filename, fileobj):
func(user,
project, filename, fileobj)
return

def validate_url(url):
if not url.startswith("http://") and not url.startswith("https://"):
raise BadRequest("Invalid url: " + url)
return url

@expose(r'^/project/fromurl/(?P<project_name>[^/]+)', "POST")
def import_from_url(request, response):
project_name = request.kwargs['project_name']

url = request.body
url = validate_url(request.body)
try:
resp = httplib2.Http().request(url, method="HEAD")
except httplib2.HttpLib2Error, e:
Expand Down
4 changes: 2 additions & 2 deletions backend/python/bespin/model.py
Expand Up @@ -57,8 +57,8 @@

Base = declarative_base()

# quotas are expressed in 1 million byte increments
QUOTA_UNITS = 1000000
# quotas are expressed in 1 megabyte increments
QUOTA_UNITS = 1048576

class ConflictError(Exception):
pass
Expand Down
7 changes: 4 additions & 3 deletions backend/python/pavement.py
Expand Up @@ -32,7 +32,10 @@
from setuptools import find_packages
from paver.setuputils import find_package_data

from paver.defaults import *
from paver.easy import *
from paver import setuputils
setuputils.install_distutils_tasks()


execfile(os.path.join('bespin', '__init__.py'))

Expand Down Expand Up @@ -85,8 +88,6 @@ def production():
non_production_packages.add(name)
external_libs.append("libs/%s" % (f.basename()))

sh("../../bin/pip freeze -r ../../requirements.txt %s" % (production_requirements))

lines = production_requirements.lines()

requirement_pattern = re.compile(r'^(.*)==')
Expand Down
2 changes: 1 addition & 1 deletion backend/python/production/pavement.py
@@ -1,4 +1,4 @@
from paver.defaults import *
from paver.easy import *

import paver.virtual

Expand Down
2 changes: 2 additions & 0 deletions backend/python/setup.py
@@ -1,5 +1,7 @@
# Don't run this. This is just for pip.

from paver import tasks
tasks.environment = tasks.Environment()
import pavement
from setuptools import setup

Expand Down

0 comments on commit 0385327

Please sign in to comment.