mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-06 12:00:13 +01:00
git-svn-id: https://svn.wxwidgets.org/svn/wx/sandbox/trunk/Phoenix@66114 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
57 lines
1.6 KiB
Python
57 lines
1.6 KiB
Python
#---------------------------------------------------------------------------
|
|
# Name: etgtools/tweaker_tools.py
|
|
# Author: Robin Dunn
|
|
#
|
|
# Created: 3-Nov-2010
|
|
# Copyright: (c) 2010 by Total Control Software
|
|
# Licence: wxWindows license
|
|
#---------------------------------------------------------------------------
|
|
|
|
"""
|
|
Some helpers and utility functions that can assist with the tweaker
|
|
stage of the ETG scripts.
|
|
"""
|
|
|
|
import extractors
|
|
|
|
|
|
|
|
def removeWxPrefixes(node):
|
|
"""
|
|
Rename items with a 'wx' prefix to not have the prefix.
|
|
"""
|
|
for item in node.allItems():
|
|
if not item.pyName \
|
|
and item.name.startswith('wx') \
|
|
and not item.name.startswith('wxEVT_') \
|
|
and not isinstance(item, (extractors.TypedefDef,
|
|
extractors.MethodDef )): # TODO: Any others?
|
|
item.pyName = item.name[2:]
|
|
|
|
|
|
|
|
def ignoreAssignmentOperators(node):
|
|
"""
|
|
Set the ignored flag for all class methods that are assignment operators
|
|
"""
|
|
for item in node.allItems():
|
|
if isinstance(item, extractors.MethodDef) and item.name == 'operator=':
|
|
item.ignore()
|
|
|
|
|
|
def ignoreAllOperators(node):
|
|
"""
|
|
Set the ignored flag for all class methods that are any kind of operator
|
|
"""
|
|
for item in node.allItems():
|
|
if isinstance(item, extractors.MethodDef) and item.name.startswith('operator'):
|
|
item.ignore()
|
|
|
|
|
|
def createPyArgsStrings(node):
|
|
"""
|
|
TODO: Create a pythonized version of the argsString in function and method
|
|
items that can be used as part of the docstring.
|
|
"""
|
|
pass
|