summaryrefslogtreecommitdiff
path: root/tbc
diff options
context:
space:
mode:
authorhardythe12014-04-30 15:03:38 +0530
committerhardythe12014-04-30 15:03:38 +0530
commit6fb17e23b11e5ed79a593c0dd4026606c3d84d42 (patch)
tree9a7a59823ddbe148bfac68817a7987e14ad0d8cf /tbc
parent3f9860881e4a11fc7b743a787691e3f5d7662539 (diff)
downloadPython-TBC-Interface-6fb17e23b11e5ed79a593c0dd4026606c3d84d42.tar.gz
Python-TBC-Interface-6fb17e23b11e5ed79a593c0dd4026606c3d84d42.tar.bz2
Python-TBC-Interface-6fb17e23b11e5ed79a593c0dd4026606c3d84d42.zip
changes to escape special characters in file name
Diffstat (limited to 'tbc')
-rw-r--r--tbc/models.py2
-rwxr-xr-xtbc/views.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/tbc/models.py b/tbc/models.py
index 4465a4d..76c9dc6 100644
--- a/tbc/models.py
+++ b/tbc/models.py
@@ -38,6 +38,8 @@ ABOUT_PROJ = (("pythontbc website", "Python TBC Website"),
("posters in college", "Through Posters in College"),
("others", "Others"))
+
+
def get_notebook_dir(instance, filename):
return '%s/%s/%s' % (instance.book.contributor, instance.book.title.replace(' ', '_'), filename.replace(' ', '_'))
diff --git a/tbc/views.py b/tbc/views.py
index fd8fed3..0c75f96 100755
--- a/tbc/views.py
+++ b/tbc/views.py
@@ -605,11 +605,9 @@ def ConvertNotebook(request, notebook_path=None):
try:
template = path.split("/")[8:]
template = "/".join(template)+notebook_name+".html"
- print ("try")
return render_to_response(template, {})
except:
- os.popen("ipython nbconvert --to html "+path+notebook_name+".ipynb")
+ os.popen("ipython nbconvert --to html \""+path+notebook_name+".ipynb\"")
template = path.split("/")[8:]
template = "/".join(template)+notebook_name+".html"
- print ("except")
return render_to_response(template, {})