equal
deleted
inserted
replaced
17 # Free Software Foundation, Inc., |
17 # Free Software Foundation, Inc., |
18 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
19 # |
19 # |
20 |
20 |
21 import os.path |
21 import os.path |
|
22 |
|
23 import settings |
|
24 |
|
25 def isImage (fname) : |
|
26 """ |
|
27 Is the given filename likely to be an image file? |
|
28 """ |
|
29 |
|
30 fname = fname.lower() |
|
31 base, ext = os.path.splitext(fname) |
|
32 ext = ext.lstrip('.') |
|
33 |
|
34 return ext in settings.IMAGE_EXTS |
22 |
35 |
23 def readFile (path) : |
36 def readFile (path) : |
24 fo = open(path, 'r') |
37 fo = open(path, 'r') |
25 data = fo.read() |
38 data = fo.read() |
26 fo.close() |
39 fo.close() |