Utilities/__init__.py

changeset 1166
a94b0a2fafd7
parent 1142
01ae8e2946d3
child 1167
8beb6bacd874
diff -r 0155e7aa345d -r a94b0a2fafd7 Utilities/__init__.py
--- a/Utilities/__init__.py	Sat Jul 02 18:19:03 2011 +0200
+++ b/Utilities/__init__.py	Sun Jul 03 18:01:53 2011 +0200
@@ -531,6 +531,21 @@
     return flags
 
 
+def extractFlagsFromFile(filename):
+    """
+    Function to extract eric specific flags out of the given file.
+    
+    @param filename name of the file to be scanned (string)
+    @return dictionary of string, boolean, complex, float and int
+    """
+    try:
+        source, encoding = readEncodedFile(filename)
+    except (UnicodeError, IOError):
+        return {}
+    
+    return extractFlags(source)
+
+
 def toNativeSeparators(path):
     """
     Function returning a path, that is using native separator characters.

eric ide

mercurial