#print >> sys.stderr, 'Writing to ', POST_TO SELF = AKARA.module_config.get('self', 'http://*****:*****@simple_service('POST', SERVICE_ID, 'moincms.execute') def execute(top=None): ''' Sample request: curl -F "pattern=wiki/path" -F "wiki=http://localhost:8880/moin/foo/" "http://localhost:8880/moincms.execute" ''' # #wikibase_len = len(rewrite) body = StringIO(body)
import sys, time import urllib, urllib2, urlparse from subprocess import * import cgi from cStringIO import StringIO from itertools import * from contextlib import closing from amara import _ from amara.lib.util import * import akara from akara.util import copy_auth from akara.services import simple_service Q_REQUIRED = _("The 'q' POST parameter is mandatory.") SVN_COMMIT_CMD = akara.module_config().get('svn_commit', 'svn commit -m "%(msg)s" %(fpath)s') SVN_ADD_CMD = akara.module_config().get('svn_add', 'svn add %(fpath)s') SERVICE_ID = 'http://purl.org/akara/services/demo/svncommit' @simple_service('POST', SERVICE_ID, 'akara.svncommit', 'text/plain') def svncommit(body, ctype, **params): '''Commit a file. Can optionally populate the file contents from a given URL. The form parameters are: fpath - the name of the file to commit to SVN msg - the commit message q (optional) - fetch the given URL and save it to the specified file before commmiting The form must be POSTed as multipart/form-data. If the request includes the 'q' parameter then the new fetch will contain authentication
SELF = AKARA.module_config.get('self', 'http://*****:*****@simple_service('POST', SERVICE_ID, 'moincms.execute') def execute(top=None): ''' Sample request: curl -F "pattern=wiki/path" -F "wiki=http://localhost:8880/moin/foo/" "http://localhost:8880/moincms.execute" ''' #