cleanup gdrive, closes #99
authorSeth Woodworth <seth@sethish.com>
Thu, 23 May 2013 22:50:51 +0000 (18:50 -0400)
committerSeth Woodworth <seth@sethish.com>
Thu, 23 May 2013 22:50:51 +0000 (18:50 -0400)
karmaworld/apps/notes/gdrive.py

index e5a8b877dc1d4211cfdbdad42add375d1949c8ce..ac11751b04625102e5209af4a8c5b02aa8200e29 100644 (file)
@@ -95,13 +95,6 @@ def convert_with_google_drive(note):
     # i.e: file_type = 'text/plain', encoding = None
     (file_type, encoding) = mimetypes.guess_type(note.note_file.path)
 
-    # If mimetype cannot be guessed
-    # Check against known issues, then
-    # finally, Raise Exception
-    # Extract file extension and compare it to EXT_TO_MIME dict
-
-
-
     resource = {
                 'title':    note.name,
             }
@@ -126,7 +119,7 @@ def convert_with_google_drive(note):
     # get the file extension
     filename, extension = os.path.splitext(note.note_file.path)
     # Upload the file
-    if extension.lower() in ['.pdf', '.jpg', '.png']:
+    if extension.lower() in ['.pdf', '.jpeg', '.jpg', '.png']:
         # include OCR on ocr-able files
         file_dict = service.files().insert(body=resource, media_body=media, convert=True, ocr=True).execute()
     else: