doc formating

This commit is contained in:
j 2010-12-24 16:01:44 +05:30
parent eb6fdd66de
commit 33351a024e
3 changed files with 55 additions and 20 deletions

16
README
View File

@ -30,7 +30,7 @@ you need python, bazaar, pip and virtualenv and several other python modules:
(make sure you have the python bindings installed). (make sure you have the python bindings installed).
create a postgresql database and adjust settings in local_settings.py 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. you might want to load example configurations from fixutes.
* RabbitMQ * RabbitMQ
@ -50,10 +50,19 @@ you need python, bazaar, pip and virtualenv and several other python modules:
Running developer environment: Running developer environment:
in one terminal: in one terminal:
python manage.py runserver ./manage.py runserver
and in another one: 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 == == DEPLOYMENT ==
To run pan.do/ra in production, we use nginx, using apache2 is also possible. 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 apache2-mpm-prefork
sudo apt-get install libapache2-mod-xsendfile sudo apt-get install libapache2-mod-xsendfile

View File

@ -59,15 +59,22 @@ def update(request):
info info
call volume/files first and fill in requested info after that call volume/files first and fill in requested info after that
param data param data {
volume: '', volume: '',
files: [ files: [
{oshash:, path:, mtime:, } {oshash:, path:, mtime:, },
] ...
],
info: {oshash: object} info: {oshash: object}
}
return {'status': {'code': int, 'text': string}, return {
'data': {info: list, data: list, file: list}} status: {'code': int, 'text': string},
data: {
info: list,
data: list,
file: list
}
}
''' '''
data = json.loads(request.POST['data']) data = json.loads(request.POST['data'])
user = request.user user = request.user
@ -121,8 +128,13 @@ def upload(request):
frame: [] //multipart frames frame: [] //multipart frames
file: [] //multipart file file: [] //multipart file
return {'status': {'code': int, 'text': string}, return {
'data': {info: object, rename: object}} status: {'code': int, 'text': string},
data: {
info: object,
rename: object
}
}
''' '''
user = request.user user = request.user
f = get_object_or_404_json(models.File, oshash=request.POST['oshash']) f = get_object_or_404_json(models.File, oshash=request.POST['oshash'])
@ -219,11 +231,17 @@ actions.register(taskStatus)
def editFile(request): def editFile(request):
''' '''
change file / item link change file / item link
param data param data {
oshash hash of file oshash: hash of file
itemId new itemId itemId: new itemId
return {'status': {'code': int, 'text': string}, }
'data': {imdbId:string }}
return {
status: {'code': int, 'text': string},
data: {
imdbId:string
}
}
''' '''
#FIXME: permissions, need to be checked #FIXME: permissions, need to be checked
data = json.loads(request.POST['data']) data = json.loads(request.POST['data'])

View File

@ -290,7 +290,9 @@ def parse(request): #parse path and return info
} }
return { return {
status: {'code': int, 'text': string}, status: {'code': int, 'text': string},
data: {imdb: string} data: {
imdb: string
}
} }
''' '''
path = json.loads(request.POST['data'])['path'] path = json.loads(request.POST['data'])['path']
@ -307,7 +309,8 @@ def setPosterFrame(request): #parse path and return info
} }
return { return {
status: {'code': int, 'text': string}, status: {'code': int, 'text': string},
data: {} data: {
}
} }
''' '''
data = json.loads(request.POST['data']) data = json.loads(request.POST['data'])
@ -330,7 +333,9 @@ def setPoster(request): #parse path and return info
} }
return { return {
status: {'code': int, 'text': string}, status: {'code': int, 'text': string},
data: {poster: {url,width,height}} data: {
poster: {url,width,height}
}
} }
''' '''
data = json.loads(request.POST['data']) data = json.loads(request.POST['data'])
@ -361,7 +366,9 @@ def getImdbId(request):
} }
return { return {
status: {'code': int, 'text': string}, status: {'code': int, 'text': string},
data: {imdbId:string } data: {
imdbId:string
}
} }
''' '''
imdbId = ox.web.imdb.guess(search_title, r['director'], timeout=-1) imdbId = ox.web.imdb.guess(search_title, r['director'], timeout=-1)