[nanny] Disable glib regexp on windows for the moment
- From: Roberto Majadas <telemaco src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nanny] Disable glib regexp on windows for the moment
- Date: Sun, 23 Jan 2011 18:03:46 +0000 (UTC)
commit e4b94961b125f69f4e23f4c55733c8b89ca6f55e
Author: Roberto Majadas <roberto majadas openshine com>
Date: Tue Sep 28 02:10:25 2010 +0200
Disable glib regexp on windows for the moment
daemon/src/FilterManager.py | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/daemon/src/FilterManager.py b/daemon/src/FilterManager.py
index e8c5a8b..7f7c544 100644
--- a/daemon/src/FilterManager.py
+++ b/daemon/src/FilterManager.py
@@ -48,9 +48,15 @@ elif os.name == "nt":
g.g_regex_match_simple.restype=c_int
g.g_regex_match_simple.argtypes=[c_wchar_p, c_wchar_p, c_int, c_int]
+import re
+
def regexp(expr, item):
try:
- return bool(g.g_regex_match_simple(expr, item, 0, 0))
+ #ret = g.g_regex_match_simple(expr, item, 0, 0)
+ p = re.compile(expr)
+ ret = bool(p.match(item))
+ print "GREGEXP>> expr: '%s' item: '%s' ----> %s" % (expr, item, ret)
+ return ret
except:
print "Regex failure"
return False
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]