From: Stefan Behnel Date: Tue, 12 Feb 2013 20:29:12 +0000 (+0100) Subject: minor cleanups in Code.py X-Git-Tag: 0.19b1~192 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d1e3aee94e9f3a1bc894ee162b250192445e3a0a;p=platform%2Fupstream%2Fpython-cython.git minor cleanups in Code.py --- diff --git a/Cython/Compiler/Code.py b/Cython/Compiler/Code.py index cc4bd73..af9ab37 100644 --- a/Cython/Compiler/Code.py +++ b/Cython/Compiler/Code.py @@ -55,12 +55,14 @@ modifier_output_mapper = { 'inline': 'CYTHON_INLINE' }.get + def get_utility_dir(): # make this a function and not global variables: # http://trac.cython.org/cython_trac/ticket/475 Cython_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) return os.path.join(Cython_dir, "Utility") + class UtilityCodeBase(object): """ Support for loading utility code from a file. @@ -144,7 +146,7 @@ class UtilityCodeBase(object): replace_comments = re.compile(r'^\s*//.*|^\s*/\*[^*]*\*/').sub match_special = re.compile( (r'^%(C)s{5,30}\s*(?P(?:\w|\.)+)\s*%(C)s{5,30}|' - r'^%(C)s+@(?P\w+)\s*:\s*(?P(?:\w|[.:])+)' # add more tag names here at need + r'^%(C)s+@(?P\w+)\s*:\s*(?P(?:\w|[.:])+)' ) % {'C':comment}).match match_type = re.compile('(.+)[.](proto|impl|init|cleanup)$').match @@ -293,6 +295,7 @@ class UtilityCodeBase(object): def get_tree(self): pass + class UtilityCode(UtilityCodeBase): """ Stores utility code to add during code generation.