Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install svenweb

How to install svenweb

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install svenweb
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.6 Available View build log
0.5 Available View build log
Windows (64-bit)
0.6 Available View build log
0.5 Available View build log
Mac OS X (10.5+)
0.6 Available View build log
0.5 Available View build log
Linux (32-bit)
0.6 Available View build log
0.5 Available View build log
Linux (64-bit)
0.6 Available View build log
0.5 Available View build log
 
License
GPLv3 or later
Depended by
Lastest release
version 0.6 on Jan 5th, 2011

Svenweb is a web environment for editing and publishing versioned documents.

It uses a version-controlled repository as its database and works against a checkout. Currently supported backends are SVN and BZR. BZR is better.

Quickstart:

System Message: WARNING/2 (<string>, line 8)

Literal block expected; none found.

virtualenv svenweb; cd svenweb; source bin/activate easy_install -e -b . svenweb easy_install bzr cd svenweb python setup.py develop bzr init /tmp/bzr paster serve paste.ini

The application will now be running on localhost:5052 against a new BZR repository in /tmp/bzr.

Now navigate to a path to start editing a file there.

What it doesn't do

Svenweb doesn't care about authentication. If you do, you should configure this outside of svenweb or in an additional WSGI middleware layer.

Likewise svenweb doesn't respect authentication. Commits will all be made by the system's default user. In a future version this will change to respect environment variables.

Svenweb doesn't provide in-browser diffs between revisions. I'd like to add this eventually.

Svenweb doesn't provide RSS for changes. It should.

Svenweb doesn't provide facilities for moving, copying or deleting files through the web. Adding these will likely be my next priority.

Usage

Svenweb uses a wiki-style workflow for adding new documents: just visit the URL of the document you want to create. You'll find an edit form.

If you visit /baz/bar/foo/ then the directories /baz/ and /baz/bar/ will be created and checked in to the repository if they do not yet exist.

Svenweb aggressively redirects redundant versions of all its views:

  • If a document /foo was last changed in r5 and you visit /foo?version=8,

System Message: WARNING/2 (<string>, line 53)

Bullet list ends without a blank line; unexpected unindent.

you will be redirected to /foo?version=5.

  • If /foo's last change was in r5 and you visit /foo you will be redirected

System Message: WARNING/2 (<string>, line 56)

Bullet list ends without a blank line; unexpected unindent.

to /foo?version=5.

This means that every URL with a ?version parameter can be cached forever if you want.

Read

Visit a document's URL to view its latest version.

Append ?version=5 to view it as of r5.

Write

Visit /foo?view=edit to edit the document stored at /foo.

You can edit the file, and also set a mimetype which will be used when serving the file.

You can also add a commit message. If you don't, the default commit message is "foom."

Index

You can view the contents of a directory by visiting the directory's URL. Versions work here too; visiting directory /baz/bar/?version=5 will display the contents of that directory as of r5.

History

You can view a history (changelog) for any file or directory's URL by using the querystring ?view=history.

For directories, this will display the history of changes within that directory, including file additions and modifications in subdirectories.

You can use ?version=5 modifiers as well, to see a history of changes up through the version specified.

Miscellany

Tests

There are the beginnings of a test suite in the ./ftests directory. These are flunc tests, which run twill scripts over HTTP. You should easy_install flunc if you want to run the tests.

To run them, start a svenweb server on localhost:5052 with svenweb.checkout_dir = /tmp/svnco/

Then run ./run-flunc.sh

It should work with both the SVN and BZR backends.

Templates

The templates are Tempita templates. They are minimal by design. You can fork them; just change the value of svenweb.templates_dir in the paste.ini file.

Using bazaar

To use the BZR backend you should be running bzr 2.0 or so. This is for the "index" view specifically i.e. for directory views. In 2.0 bzr makes it easier to find the last changed revision of any file within a directory.

See https://bugs.edge.launchpad.net/bzr/+bug/97715

Note that svenweb's current implementation of the index view WILL NOT WORK with mod_wsgi because of a call to sys.stdout.flush() in bzrlib.commands which is triggered by sven.bzr.log -- I really ought to fix this in sven.bzr by implementing the log method more properly, somehow.

Changelog

New in this version
  • Remove various imports that cause ImportErrors unless pysvn libs / bzr libs / hbmp are installed
  • Add flunc tests
  • Backtracking on mimetype, moving towards generic metadata
  • 404 (instead of 500) when visiting a document at a revision past

System Message: WARNING/2 (<string>, line 153)

Bullet list ends without a blank line; unexpected unindent.

the repo HEAD. The response body contains a link to the document at the repo HEAD.

  • 404 (instead of 500) when visiting a document at a revision prior

System Message: WARNING/2 (<string>, line 157)

Bullet list ends without a blank line; unexpected unindent.

to that document's birth. The response body contains a link to the document at the revision of its birth.

What's next

A little speculative roadmap:

N: This version.

N+1: Copying, moving and deleting files. Some refactoring of WSGI components.

N+2: Using REMOTE_USER to determine the username to commit with, or something like that. More refactoring of WSGI components.

N+3: RSS or atom feeds. Diffs between arbitrary revisions. More refactoring.

History
0.5 (2010-02-16)
  • Fixed several bugs in link generation (index pages, redirects after save) which

System Message: WARNING/2 (<string>, line 184)

Bullet list ends without a blank line; unexpected unindent.

had been incorrect when svenweb was not mounted at the root of the URL space.

  • Refactoring and cleanup.
0.4.1 (2010-01-30)
  • Better hbmp handling
0.4 (2010-01-30)
  • Fix mimetype handling which seems to have been really quite broken

System Message: WARNING/2 (<string>, line 199)

Bullet list ends without a blank line; unexpected unindent.

for god knows how long. It now all behaves as you'd expect.

  • Abstract out template_loader option, which should be a callable

System Message: WARNING/2 (<string>, line 202)

Bullet list ends without a blank line; unexpected unindent.

which takes a (template_name, data_dict) and returns a string. The default is the existing Tempita stuff. This interface will probably change. It can be an object configured however it likes, currently that's just handled in the paste.deploy factory.

  • Internal refactoring of components for easier pluggability of

System Message: WARNING/2 (<string>, line 208)

Bullet list ends without a blank line; unexpected unindent.

custom edit apps (which handle editform, addform and save) and view apps (which handle rendering)

Demo of custom view apps: custom display for text/csv+hbmp format!

0.3 (2010-01-30)
  • When displaying an edit form for a file that does not exist,

System Message: WARNING/2 (<string>, line 218)

Bullet list ends without a blank line; unexpected unindent.

use the return value of mimetypes.guess_type as the default mimetype for the file in the form. If no guessable mimetype is found, the default is 'text/html'.

This behavior can be overridden by subclassing SvnWikiView and implementing a custom new_file_default_mimetype_policy method. The method should take a request argument.

0.2 (2010-01-26)
  • BZR repositories are now supported. This is much faster than

System Message: WARNING/2 (<string>, line 231)

Bullet list ends without a blank line; unexpected unindent.

SVN. To use, simply add 'svenweb.repo_type=bzr' to your paste.deploy configuration.

  • Added a WSGI middleware filter to set a response's Content-type

System Message: WARNING/2 (<string>, line 235)

Bullet list ends without a blank line; unexpected unindent.

header based on the versioned mimetype property of a resource. It can be used independent of the rest of svenweb, for example if you want to publish the current contents of your versioned resources with a static file server. Use like

[filter:contenttype] use = egg:svenweb#content_type checkout_dir = /path/to_your/checkout/ default_content_type = text/plain repo_type = bzr

The 'repo_type' and 'default_content_type' settings are optional.

0.1.1 (2010-01-03)

First release.

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.