pygobject r974 - in trunk: . codegen
- From: finlay svn gnome org
- To: svn-commits-list gnome org
- Subject: pygobject r974 - in trunk: . codegen
- Date: Sat, 1 Nov 2008 01:06:49 +0000 (UTC)
Author: finlay
Date: Sat Nov 1 01:06:49 2008
New Revision: 974
URL: http://svn.gnome.org/viewvc/pygobject?rev=974&view=rev
Log:
* codegen/__init__.py (__all__): Add defsgen to __all__ list.
* codegen/h2def.py (find_enum_defs): Strip out # directives from
enum defintions.
(clean_func): Change ' * G_CONST_RETURN * ' to '** '
Modified:
trunk/ChangeLog
trunk/codegen/__init__.py
trunk/codegen/h2def.py
Modified: trunk/codegen/__init__.py
==============================================================================
--- trunk/codegen/__init__.py (original)
+++ trunk/codegen/__init__.py Sat Nov 1 01:06:49 2008
@@ -8,6 +8,7 @@
'docextract',
'docgen',
'h2def',
+ 'defsgen'
'mergedefs',
'mkskel',
'override',
Modified: trunk/codegen/h2def.py
==============================================================================
--- trunk/codegen/h2def.py (original)
+++ trunk/codegen/h2def.py Sat Nov 1 01:06:49 2008
@@ -174,6 +174,10 @@
# bulk comments
buf = strip_comments(buf)
+ # strip # directives
+ pat = re.compile(r"""^[#].*?$""", re.MULTILINE)
+ buf = pat.sub('', buf)
+
buf = re.sub('\n', ' ', buf)
enum_pat = re.compile(r'enum\s*{([^}]*)}\s*([A-Z][A-Za-z]*)(\s|;)')
@@ -244,6 +248,7 @@
buf = pat.sub(r'[] \1', buf)
# make return types that are const work.
+ buf = re.sub(r'\s*\*\s*G_CONST_RETURN\s*\*\s*', '** ', buf)
buf = string.replace(buf, 'G_CONST_RETURN ', 'const-')
buf = string.replace(buf, 'const ', 'const-')
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]