2015-04-08 05:54:53 +00:00
|
|
|
from .base import UnknownType
|
2015-04-08 06:42:06 +00:00
|
|
|
from .dotnet import (
|
|
|
|
DotNetNamespace, DotNetClass, DotNetMethod, DotNetProperty,
|
|
|
|
DotNetEnum, DotNetConstructor, DotNetStruct, DotNetInterface,
|
2015-04-08 22:56:05 +00:00
|
|
|
DotNetDelegate, DotNetField, DotNetEvent
|
2015-04-08 06:42:06 +00:00
|
|
|
)
|
2015-04-08 05:54:53 +00:00
|
|
|
from .python import PythonModule, PythonClass, PythonFunction
|
2015-03-27 19:50:56 +00:00
|
|
|
|
|
|
|
|
2015-04-08 05:54:53 +00:00
|
|
|
def classify(obj, obj_type):
|
|
|
|
if 'type' not in obj:
|
|
|
|
return ''
|
|
|
|
|
|
|
|
if obj_type == 'python':
|
|
|
|
if obj['type'] == 'module':
|
|
|
|
return PythonModule(obj)
|
|
|
|
if obj['type'] == 'class':
|
|
|
|
return PythonClass(obj)
|
|
|
|
if obj['type'] == 'function':
|
|
|
|
return PythonFunction(obj)
|
|
|
|
if obj_type == 'dotnet':
|
|
|
|
if obj['type'] == 'Class':
|
|
|
|
return DotNetClass(obj)
|
|
|
|
if obj['type'] == 'Namespace':
|
|
|
|
return DotNetNamespace(obj)
|
2015-04-08 06:42:06 +00:00
|
|
|
if obj['type'] == 'Property':
|
|
|
|
return DotNetProperty(obj)
|
|
|
|
if obj['type'] == 'Method':
|
|
|
|
return DotNetMethod(obj)
|
|
|
|
if obj['type'] == 'Enum':
|
|
|
|
return DotNetEnum(obj)
|
|
|
|
if obj['type'] == 'Constructor':
|
|
|
|
return DotNetConstructor(obj)
|
|
|
|
if obj['type'] == 'Struct':
|
|
|
|
return DotNetStruct(obj)
|
|
|
|
if obj['type'] == 'Interface':
|
|
|
|
return DotNetInterface(obj)
|
|
|
|
if obj['type'] == 'Delegate':
|
|
|
|
return DotNetDelegate(obj)
|
2015-04-08 22:56:05 +00:00
|
|
|
if obj['type'] == 'Field':
|
|
|
|
return DotNetField(obj)
|
|
|
|
if obj['type'] == 'Event':
|
|
|
|
return DotNetEvent(obj)
|
2015-04-08 05:54:53 +00:00
|
|
|
return UnknownType(obj)
|