Disable sendfile when running dev from vagrant.
Upgrade gunicorn. Add BS3 classes to rendered markdown tables. Fixes #72
This commit is contained in:
parent
24f681de89
commit
f59e46c7df
|
@ -1,7 +1,7 @@
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from urlparse import urlparse
|
from urlparse import urlparse
|
||||||
|
from realms.lib.util import in_vagrant
|
||||||
|
|
||||||
def update(data):
|
def update(data):
|
||||||
conf = read()
|
conf = read()
|
||||||
|
@ -152,6 +152,10 @@ SQLALCHEMY_DATABASE_URI = DB_URI
|
||||||
_url = urlparse(BASE_URL)
|
_url = urlparse(BASE_URL)
|
||||||
RELATIVE_PATH = _url.path
|
RELATIVE_PATH = _url.path
|
||||||
|
|
||||||
|
if in_vagrant():
|
||||||
|
# sendfile doesn't work well with Virtualbox shared folders
|
||||||
|
USE_X_SENDFILE = False
|
||||||
|
|
||||||
if ENV != "DEV":
|
if ENV != "DEV":
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
ASSETS_DEBUG = False
|
ASSETS_DEBUG = False
|
||||||
|
|
|
@ -126,6 +126,10 @@ def in_virtualenv():
|
||||||
return hasattr(sys, 'real_prefix')
|
return hasattr(sys, 'real_prefix')
|
||||||
|
|
||||||
|
|
||||||
|
def in_vagrant():
|
||||||
|
return os.path.isdir("/vagrant")
|
||||||
|
|
||||||
|
|
||||||
def is_su():
|
def is_su():
|
||||||
return os.geteuid() == 0
|
return os.geteuid() == 0
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,10 @@ var MDR = {
|
||||||
meta: null,
|
meta: null,
|
||||||
md: null,
|
md: null,
|
||||||
sanitize: true, // Override
|
sanitize: true, // Override
|
||||||
parse: function(md){ return marked(md); },
|
renderer: new marked.Renderer(),
|
||||||
|
parse: function(md){
|
||||||
|
return marked(md, { renderer: this.renderer });
|
||||||
|
},
|
||||||
convert: function(md, sanitize) {
|
convert: function(md, sanitize) {
|
||||||
if (this.sanitize !== null) {
|
if (this.sanitize !== null) {
|
||||||
sanitize = this.sanitize;
|
sanitize = this.sanitize;
|
||||||
|
@ -104,3 +107,14 @@ var MDR = {
|
||||||
hook: function() {
|
hook: function() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
MDR.renderer.table = function(header, body) {
|
||||||
|
return '<table class="table table-bordered">\n'
|
||||||
|
+ '<thead>\n'
|
||||||
|
+ header
|
||||||
|
+ '</thead>\n'
|
||||||
|
+ '<tbody>\n'
|
||||||
|
+ body
|
||||||
|
+ '</tbody>\n'
|
||||||
|
+ '</table>\n';
|
||||||
|
};
|
2
setup.py
2
setup.py
|
@ -37,7 +37,7 @@ setup(name='realms-wiki',
|
||||||
'gevent==1.0.2',
|
'gevent==1.0.2',
|
||||||
'ghdiff==0.4',
|
'ghdiff==0.4',
|
||||||
'gittle==0.4.0',
|
'gittle==0.4.0',
|
||||||
'gunicorn==19.1.1',
|
'gunicorn==19.3',
|
||||||
'itsdangerous==0.24',
|
'itsdangerous==0.24',
|
||||||
'markdown2==2.3.0',
|
'markdown2==2.3.0',
|
||||||
'simplejson==3.6.3'
|
'simplejson==3.6.3'
|
||||||
|
|
Loading…
Reference in a new issue