示例#1
0
文件: edit.py 项目: ejucovy/hyperbmp
def uploader_post(req):
    loc = location(req)
    fin = req.POST['file']
    mimetype = guess_type(fin.filename)[0]
    contents = fin.file.read()
    message = req.POST.get('svenweb.commit_message')
    return (contents, message, mimetype, 
            exc.HTTPSeeOther(location=loc))
示例#2
0
    def post(self, request):
        """
        return response to a POST request
        """
        contents = request.POST.get('svenweb.resource_body')

        message = request.POST.get('svenweb.commit_message')
        metadata = {}

        loc = location(request)
        return (contents, message, metadata, exc.HTTPSeeOther(location=loc))
示例#3
0
文件: edit.py 项目: ejucovy/svenweb
    def post(self, request):
        """
        return response to a POST request
        """
        contents = request.POST.get('svenweb.resource_body')

        message = request.POST.get('svenweb.commit_message')
        metadata = {}

        loc = location(request)
        return (contents, message, metadata,
                exc.HTTPSeeOther(location=loc))
示例#4
0
文件: edit.py 项目: ejucovy/svenweb
    def convert(self, request):
        assert False
        content = request.POST.get('svenweb.resource_body')

        mimetype = request.POST.get('svenweb.mimetype')
        _from = request.POST['convert_from']

        message = request.POST.get('svenweb.commit_message')

        loc = location(request)        
        return (convert(_from, mimetype, content),
                message, {'mimetype':mimetype},
                exc.HTTPSeeOther(location=loc))
示例#5
0
    def convert(self, request):
        assert False
        content = request.POST.get('svenweb.resource_body')

        mimetype = request.POST.get('svenweb.mimetype')
        _from = request.POST['convert_from']

        message = request.POST.get('svenweb.commit_message')

        loc = location(request)
        return (convert(_from, mimetype, content), message, {
            'mimetype': mimetype
        }, exc.HTTPSeeOther(location=loc))