From 14315455da2b664ca68ce8591983a30cc303d339 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 11 Apr 2014 19:17:46 +0000 Subject: [PATCH] remove debug --- pandora/archive/chunk.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pandora/archive/chunk.py b/pandora/archive/chunk.py index 97a5bb2a..1b11b665 100644 --- a/pandora/archive/chunk.py +++ b/pandora/archive/chunk.py @@ -13,15 +13,13 @@ class ChunkForm(forms.Form): offset = forms.IntegerField(required=False) done = forms.IntegerField(required=False) -def save_chunk(self, file, chunk, offset, name, done_cb=None): - print 'file', file - print 'chunk', chunk +def save_chunk(obj, file, chunk, offset, name, done_cb=None): if not file: file.name = name ox.makedirs(os.path.dirname(file.path)) with open(file.path, 'w') as f: f.write(chunk.read()) - self.save() + obj.save() else: path = file.path size = file.size @@ -34,14 +32,14 @@ def save_chunk(self, file, chunk, offset, name, done_cb=None): f.write(chunk.read()) return done_cb() if done_cb else True, file.size -def process_chunk(request, _save_chunk): +def process_chunk(request, save_chunk): response = { 'result': 1, } form = ChunkForm(request.POST, request.FILES) if form.is_valid(): d = form.cleaned_data - ok, _offset = _save_chunk(d['chunk'], d['offset'], d['done']) + ok, _offset = save_chunk(d['chunk'], d['offset'], d['done']) response['offset'] = _offset response['result'] = 1 if ok else -1 if d['done']: