diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-01-02 22:03:02 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-01-02 22:03:02 +0100 |
commit | a786fef06639da439f9edd367db36388dc1c2658 (patch) | |
tree | 84b7d7acf23c300bef4b0fd5ee744e408ffc1152 /module/remote/create_ttypes.py | |
parent | New naming: pyLoadCore -> pyload (diff) | |
download | pyload-a786fef06639da439f9edd367db36388dc1c2658.tar.xz |
little cleanup, improved handling of custom exceptions via api
Diffstat (limited to 'module/remote/create_ttypes.py')
-rw-r--r-- | module/remote/create_ttypes.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/module/remote/create_ttypes.py b/module/remote/create_ttypes.py index c50142322..544b00ee8 100644 --- a/module/remote/create_ttypes.py +++ b/module/remote/create_ttypes.py @@ -86,6 +86,9 @@ class BaseObject(object): \tdef __str__(self): \t\treturn "<%s %s>" % (self.__class__.__name__, ", ".join("%s=%s" % (k,getattr(self,k)) for k in self.__slots__)) +class ExceptionObject(Exception): +\t__slots__ = [] + """) dev = open(join(path, "ttypes_debug.py"), "wb") @@ -112,7 +115,7 @@ from ttypes import *\n for klass in classes: name = klass.__name__ - base = "Exception" if issubclass(klass, ttypes.TExceptionBase) else "BaseObject" + base = "ExceptionObject" if issubclass(klass, ttypes.TExceptionBase) else "BaseObject" f.write("class %s(%s):\n" % (name, base)) # No attributes, don't write further info |