[kupfer] textfiles: Check file existance in mime-type check
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [kupfer] textfiles: Check file existance in mime-type check
- Date: Mon, 21 Mar 2011 14:23:32 +0000 (UTC)
commit fd6c34e9f71dd9fecd37f78ad371edc23f2b8d14
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Mon Mar 21 15:22:39 2011 +0100
textfiles: Check file existance in mime-type check
kupfer/plugin/textfiles.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/kupfer/plugin/textfiles.py b/kupfer/plugin/textfiles.py
index f2515c5..001b2d5 100644
--- a/kupfer/plugin/textfiles.py
+++ b/kupfer/plugin/textfiles.py
@@ -39,6 +39,8 @@ def is_content_type(fileleaf, ctype):
return ret
content_attr = gio.FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE
gfile = gio.File(fileleaf.object)
+ if not gfile.query_exists(None):
+ return
info = gfile.query_info(content_attr)
content_type = info.get_attribute_string(content_attr)
return predicate(content_type, ctype)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]