From 33351a024e5542c4f0f7b786adea775020e44fb1 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 24 Dec 2010 16:01:44 +0530 Subject: [PATCH] doc formating --- README | 16 ++++++++++++--- pandora/archive/views.py | 44 ++++++++++++++++++++++++++++------------ pandora/item/views.py | 15 ++++++++++---- 3 files changed, 55 insertions(+), 20 deletions(-) diff --git a/README b/README index 611b499..70003b9 100644 --- a/README +++ b/README @@ -30,7 +30,7 @@ you need python, bazaar, pip and virtualenv and several other python modules: (make sure you have the python bindings installed). create a postgresql database and adjust settings in local_settings.py - and run python manage.py syncdb to populate the database + and run ./manage.py syncdb to populate the database you might want to load example configurations from fixutes. * RabbitMQ @@ -50,10 +50,19 @@ you need python, bazaar, pip and virtualenv and several other python modules: Running developer environment: in one terminal: - python manage.py runserver + ./manage.py runserver and in another one: - python manage.py celeryd -Q default,encoding + ./manage.py celeryd -Q default,encoding +Updating database: + right now database updates are not managed, each time you update to current bzr + you might have to update db tables too. + Use + ./manage.py sqldiff appname + to check if changes exist and + ./manage.py sqldiff appname | ./manage.py dbshell + to apply them. + This has to be done for all installed apps == DEPLOYMENT == To run pan.do/ra in production, we use nginx, using apache2 is also possible. @@ -65,3 +74,4 @@ To run pan.do/ra in production, we use nginx, using apache2 is also possible. sudo apt-get install apache2-mpm-prefork sudo apt-get install libapache2-mod-xsendfile + diff --git a/pandora/archive/views.py b/pandora/archive/views.py index 7cc48d9..f409767 100644 --- a/pandora/archive/views.py +++ b/pandora/archive/views.py @@ -59,15 +59,22 @@ def update(request): info call volume/files first and fill in requested info after that - param data + param data { volume: '', files: [ - {oshash:, path:, mtime:, } - ] + {oshash:, path:, mtime:, }, + ... + ], info: {oshash: object} - - return {'status': {'code': int, 'text': string}, - 'data': {info: list, data: list, file: list}} + } + return { + status: {'code': int, 'text': string}, + data: { + info: list, + data: list, + file: list + } + } ''' data = json.loads(request.POST['data']) user = request.user @@ -121,8 +128,13 @@ def upload(request): frame: [] //multipart frames file: [] //multipart file - return {'status': {'code': int, 'text': string}, - 'data': {info: object, rename: object}} + return { + status: {'code': int, 'text': string}, + data: { + info: object, + rename: object + } + } ''' user = request.user f = get_object_or_404_json(models.File, oshash=request.POST['oshash']) @@ -219,11 +231,17 @@ actions.register(taskStatus) def editFile(request): ''' change file / item link - param data - oshash hash of file - itemId new itemId - return {'status': {'code': int, 'text': string}, - 'data': {imdbId:string }} + param data { + oshash: hash of file + itemId: new itemId + } + + return { + status: {'code': int, 'text': string}, + data: { + imdbId:string + } + } ''' #FIXME: permissions, need to be checked data = json.loads(request.POST['data']) diff --git a/pandora/item/views.py b/pandora/item/views.py index ab98ad3..08f1943 100644 --- a/pandora/item/views.py +++ b/pandora/item/views.py @@ -290,7 +290,9 @@ def parse(request): #parse path and return info } return { status: {'code': int, 'text': string}, - data: {imdb: string} + data: { + imdb: string + } } ''' path = json.loads(request.POST['data'])['path'] @@ -307,7 +309,8 @@ def setPosterFrame(request): #parse path and return info } return { status: {'code': int, 'text': string}, - data: {} + data: { + } } ''' data = json.loads(request.POST['data']) @@ -330,7 +333,9 @@ def setPoster(request): #parse path and return info } return { status: {'code': int, 'text': string}, - data: {poster: {url,width,height}} + data: { + poster: {url,width,height} + } } ''' data = json.loads(request.POST['data']) @@ -361,7 +366,9 @@ def getImdbId(request): } return { status: {'code': int, 'text': string}, - data: {imdbId:string } + data: { + imdbId:string + } } ''' imdbId = ox.web.imdb.guess(search_title, r['director'], timeout=-1)