-
Notifications
You must be signed in to change notification settings - Fork 8
/
wxNamespace.py
52 lines (46 loc) · 1.14 KB
/
wxNamespace.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#-----------------------------------------------------------------------------
# Name: wxNamespace.py
# Purpose:
#
# Author: Riaan Booysen
#
# Created: 2001
# RCS-ID: $Id$
# Copyright: (c) 2001 - 2007
# Licence: GPL
#-----------------------------------------------------------------------------
import Preferences as _Prefs
import wx
import wx.html
import wx.calendar
import wx.grid
import wx.stc
import wx.gizmos
import wx.wizard
def getWxClass(name):
return getWxObjPath(name)
##def getNamesOfType(aType):
## res = []
## for k, v in globals().items():
## if type(v) == aType:
## if _Prefs.ccFilterWxPtrNames and k[-3:] == 'Ptr':
## continue
## res.append(k)
## return res
def getWxObjPath(objPath):
pathSegs = objPath.split('.')
if pathSegs[0] != 'wx':
return None
obj = wx
for name in pathSegs[1:]:
if hasattr(obj, name):
obj = getattr(obj, name)
else:
return None
return obj
def getWxNamespaceForObjPath(objPath):
obj = getWxObjPath(objPath)
if obj:
return dir(obj)
else:
return []