[Checkins] SVN: grok/branches/grok-martian/src/grok/util.py Remove some util functions that are now in martian. This process is

Martijn Faassen faassen at infrae.com
Tue Jun 19 16:25:20 EDT 2007


Log message for revision 76816:
  Remove some util functions that are now in martian. This process is
  not finished yet and some of it awaits moving the directive implementation
  into martian.
  

Changed:
  U   grok/branches/grok-martian/src/grok/util.py

-=-
Modified: grok/branches/grok-martian/src/grok/util.py
===================================================================
--- grok/branches/grok-martian/src/grok/util.py	2007-06-19 20:17:35 UTC (rev 76815)
+++ grok/branches/grok-martian/src/grok/util.py	2007-06-19 20:25:20 UTC (rev 76816)
@@ -30,28 +30,9 @@
 
 from grok.error import GrokError, GrokImportError
 
-def not_unicode_or_ascii(value):
-    if isinstance(value, unicode):
-        return False
-    if not isinstance(value, str):
-        return True
-    return is_not_ascii(value)
+from martian.util import (not_unicode_or_ascii, is_not_ascii,
+                          isclass, check_subclass)
 
-is_not_ascii = re.compile(eval(r'u"[\u0080-\uffff]"')).search
-
-
-def isclass(obj):
-    """We cannot use ``inspect.isclass`` because it will return True
-    for interfaces"""
-    return isinstance(obj, (types.ClassType, type))
-
-
-def check_subclass(obj, class_):
-    if not isclass(obj):
-        return False
-    return issubclass(obj, class_)
-
-
 def caller_module():
     return sys._getframe(2).f_globals['__name__']
 



More information about the Checkins mailing list