slackbuilds_ponce/multimedia/flowblade/gnomevfs.patch
klaatu 6cbc8e0506 multimedia/flowblade: Updated for version 0.10.0.
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
2013-12-02 00:58:02 -06:00

43 lines
1.2 KiB
Diff

--- ./flowblade-0.10.0/Flowblade/sequence.py 2013-09-14 09:49:39.000000000 -0400
+++ sequence.py 2013-11-28 22:34:02.454226123 -0500
@@ -24,7 +24,7 @@
"""
import copy
-import gnomevfs
+import urllib, mimetypes
import mlt
import time #added when testing
import types
@@ -914,8 +914,13 @@
"""
Returns media type of file.
"""
+ # using urllib and mimetype for non gnome environments
try:
- mime_type = gnomevfs.get_mime_type(file_path)
+ url = urllib.pathname2url(file_path)
+ mime_guess = mimetypes.guess_type(url)
+ mime_string = mime_guess[0]
+ mime_type = str.split(mime_string, "/")
+
except Exception, err:
if not os.path.exists(file_path):
# We're doing a heuristic here to identify image sequence file_paths.
@@ -932,13 +937,13 @@
else:
return UNKNOWN
- if mime_type.startswith("video"):
+ if mime_type[0] == "video":
return VIDEO
- if mime_type.startswith("audio"):
+ if mime_type[0] == "audio":
return AUDIO
- if mime_type.startswith("image"):
+ if mime_type[0] == "image":
return IMAGE
return UNKNOWN