diff options
-rw-r--r-- | pyload/remote/socketbackend/create_ttypes.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pyload/remote/socketbackend/create_ttypes.py b/pyload/remote/socketbackend/create_ttypes.py index 26dd5d06b..00752dc6b 100644 --- a/pyload/remote/socketbackend/create_ttypes.py +++ b/pyload/remote/socketbackend/create_ttypes.py @@ -14,7 +14,6 @@ from pyload.remote.thriftbackend.thriftgen.pyload.Pyload import Iface def main(): - enums = [] classes = [] @@ -23,11 +22,12 @@ def main(): for name in dir(ttypes): klass = getattr(ttypes, name) - if name in ("TBase", "TExceptionBase") or name.startswith("_") or not (issubclass(klass, ttypes.TBase) or issubclass(klass, ttypes.TExceptionBase)): + if name in ("TBase", "TExceptionBase") or name.startswith("_") or not ( + issubclass(klass, ttypes.TBase) or issubclass(klass, ttypes.TExceptionBase)): continue if hasattr(klass, "thrift_spec"): - classes.append(klass) + classes.append(klass) else: enums.append(klass) @@ -44,7 +44,7 @@ class BaseObject(object): """) - ## generate enums + # generate enums for enum in enums: name = enum.__name__ f.write("class %s:\n" % name) @@ -60,10 +60,10 @@ class BaseObject(object): for klass in classes: name = klass.__name__ base = "Exception" if issubclass(klass, ttypes.TExceptionBase) else "BaseObject" - f.write("class %s(%s):\n" % (name, base)) + f.write("class %s(%s):\n" % (name, base)) f.write("\t__slots__ = %s\n\n" % klass.__slots__) - #create init + # create init args = ["self"] + ["%s=None" % x for x in klass.__slots__] f.write("\tdef __init__(%s):\n" % ", ".join(args)) |