|
2 | 2 | import glob |
3 | 3 | import itertools |
4 | 4 | import os |
5 | | -import subprocess |
6 | 5 |
|
7 | 6 | import debug # pyflakes:ignore |
8 | 7 |
|
|
27 | 26 | from ietf.secr.proceedings.proc_utils import ( gen_acknowledgement, gen_agenda, gen_areas, |
28 | 27 | gen_attendees, gen_group_pages, gen_index, gen_irtf, gen_overview, gen_plenaries, |
29 | 28 | gen_progress, gen_research, gen_training, create_proceedings, create_recording ) |
30 | | -from ietf.utils.log import log |
31 | 29 |
|
32 | 30 | # ------------------------------------------------- |
33 | 31 | # Globals |
@@ -139,39 +137,8 @@ def parsedate(d): |
139 | 137 | This function takes a date object and returns a tuple of year,month,day |
140 | 138 | ''' |
141 | 139 | return (d.strftime('%Y'),d.strftime('%m'),d.strftime('%d')) |
142 | | - |
143 | | -def is_powerpoint(doc): |
144 | | - ''' |
145 | | - Returns true if document is a Powerpoint presentation |
146 | | - ''' |
147 | | - return doc.file_extension() in ('ppt','pptx') |
148 | | - |
149 | | -def post_process(doc): |
150 | | - ''' |
151 | | - Does post processing on uploaded file. |
152 | | - - Convert PPT to PDF |
153 | | - ''' |
154 | | - if is_powerpoint(doc) and hasattr(settings,'SECR_PPT2PDF_COMMAND'): |
155 | | - try: |
156 | | - cmd = settings.SECR_PPT2PDF_COMMAND |
157 | | - cmd.append(doc.get_file_path()) # outdir |
158 | | - cmd.append(os.path.join(doc.get_file_path(),doc.external_url)) # filename |
159 | | - subprocess.check_call(cmd) |
160 | | - except (subprocess.CalledProcessError, OSError) as error: |
161 | | - log("Error converting PPT: %s" % (error)) |
162 | | - return |
163 | | - # change extension |
164 | | - base,ext = os.path.splitext(doc.external_url) |
165 | | - doc.external_url = base + '.pdf' |
166 | | - |
167 | | - e = DocEvent.objects.create( |
168 | | - type='changed_document', |
169 | | - by=Person.objects.get(name="(System)"), |
170 | | - doc=doc, |
171 | | - desc='Converted document to PDF', |
172 | | - ) |
173 | | - doc.save_with_history([e]) |
174 | 140 |
|
| 141 | + |
175 | 142 | # ------------------------------------------------- |
176 | 143 | # AJAX Functions |
177 | 144 | # ------------------------------------------------- |
|
0 commit comments