From 8849fb2b2b8dc824bd3f17ce1026a04856477a94 Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Sun, 4 Mar 2018 18:08:04 -0500 Subject: working division, prints, and metaclasses, but imports broken, still needs work --- python/platform.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'python/platform.py') diff --git a/python/platform.py b/python/platform.py index dd756178..ff59be50 100644 --- a/python/platform.py +++ b/python/platform.py @@ -20,15 +20,16 @@ import ctypes -# Binary Ninja components -import _binaryninjacore as core -import startup -import architecture -import callingconvention -import types +# Binary Ninja components -- additional imports belong in the appropriate class +from binaryninja import _binaryninjacore as core + +#2-3 compatibility +from six import with_metaclass class _PlatformMetaClass(type): + from binaryninja import startup + from binaryninja import types @property def list(self): startup._init_plugins() @@ -90,12 +91,14 @@ class _PlatformMetaClass(type): return result -class Platform(object): +class Platform(with_metaclass(_PlatformMetaClass, object)): """ ``class Platform`` contains all information releated to the execution environment of the binary, mainly the calling conventions used. """ - __metaclass__ = _PlatformMetaClass + from binaryninja import architecture + from binaryninja import callingconvention + from binaryninja import types name = None def __init__(self, arch, handle = None): -- cgit v1.3.1