diff --git a/.DS_Store b/.DS_Store index 618d33d..9246838 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index e15ce6b..3cf4fd5 100644 --- a/.gitignore +++ b/.gitignore @@ -2,8 +2,8 @@ __pycache__/ *.pyc *~ app/uploads/** -!app/uploads/cover -/cover/** +app/cover/** +!app/cover/default_cover.gif app/mydatabase.db pyrqlite/ whoosh/ diff --git a/app/cover.py b/app/cover.py index 19de8e1..7fbb835 100755 --- a/app/cover.py +++ b/app/cover.py @@ -29,9 +29,17 @@ def get_cover(file_path, filename): # ==== print(file_path) src_filename = file_path - - src_pdf = PyPDF2.PdfFileReader(open(src_filename, "rb")) - + try: + src_pdf = PyPDF2.PdfFileReader(open(src_filename, "rb")) + except: + print("couln't open PDF") + return None; + if src_pdf.isEncrypted: + try: + src_pdf.decrypt('') + except: + print("couln't decrypt") + return None; # What follows is a lookup table of page numbers within sample_log.pdf and the corresponding filenames. pages = [{"pagenum": 0, "filename": filename}] diff --git a/app/cover/default_cover.gif b/app/cover/default_cover.gif new file mode 100644 index 0000000..500390c Binary files /dev/null and b/app/cover/default_cover.gif differ diff --git a/app/static/img/default_cover.png b/app/static/img/default_cover.png index 34c107e..a587643 100644 Binary files a/app/static/img/default_cover.png and b/app/static/img/default_cover.png differ diff --git a/app/templates/_formhelpers.html b/app/templates/_formhelpers.html index d4ad8c2..01adf81 100644 --- a/app/templates/_formhelpers.html +++ b/app/templates/_formhelpers.html @@ -9,4 +9,4 @@ {% endif %} -{% endmacro %} \ No newline at end of file +{% endmacro %} diff --git a/app/templates/about.html b/app/templates/about.html index 8ed8990..7eba7fc 100755 --- a/app/templates/about.html +++ b/app/templates/about.html @@ -2,7 +2,7 @@ {% block main %}

About

-
+

XPPL is a project aimed at people who are studying the field of media culture, or as we like to call them: knowledge comrades.
diff --git a/app/templates/add_to_stacks.html b/app/templates/add_to_stacks.html index 6cece35..55b825e 100644 --- a/app/templates/add_to_stacks.html +++ b/app/templates/add_to_stacks.html @@ -6,7 +6,7 @@

Chosen book:

{{ book.title }}

- +

These are all the stacks that have been built so far.

diff --git a/app/templates/annotations.html b/app/templates/annotations.html index f76fbc3..f98de5d 100644 --- a/app/templates/annotations.html +++ b/app/templates/annotations.html @@ -63,6 +63,3 @@ {% endblock %} - - - diff --git a/app/templates/edit_book_detail.html b/app/templates/edit_book_detail.html index 7a9675f..d389190 100755 --- a/app/templates/edit_book_detail.html +++ b/app/templates/edit_book_detail.html @@ -26,7 +26,7 @@ function outputUpdate3(gender) {

{{ form.title.label }} {{ form.title(size=20, class="form-control") }}

-
+

@@ -73,11 +73,11 @@ Who are you? {{ render_field(form.who)}} Current file: {{ book.file }}      Upload new file: {{form.file}}
- +
- If uploading, write a new message:
{{form.message(size=135, class="form-control") }} + If uploading, write a new message:
{{form.message(size=135, class="form-control") }}

diff --git a/app/templates/red_link.html b/app/templates/red_link.html index 74c58b2..cf41e34 100755 --- a/app/templates/red_link.html +++ b/app/templates/red_link.html @@ -35,7 +35,7 @@ {%if light%} {%else%}
- +

@@ -98,7 +98,7 @@ - +