Bug 977464 follow-up: Fix the indentation to use 4 spaces
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 15 Jan 2016 10:39:39 -0500
changeset 322103 6a13366e86f4e9e132c5e5fa7f7d6d505975987e
parent 322102 269ad7540a30bcfc47ce0176ee69a49cd1607ca2
child 322104 7e9ff754bb089d1941b590505520f4245dcb23ae
push id9530
push userdmitchell@mozilla.com
push dateFri, 15 Jan 2016 19:42:24 +0000
bugs977464
milestone46.0a1
Bug 977464 follow-up: Fix the indentation to use 4 spaces
xpcom/typelib/xpt/tools/xpt.py
--- a/xpcom/typelib/xpt/tools/xpt.py
+++ b/xpcom/typelib/xpt/tools/xpt.py
@@ -152,20 +152,20 @@ class Type(object):
     def __init__(self, pointer=False, reference=False):
         self.pointer = pointer
         self.reference = reference
         if reference and not pointer:
             raise Exception("If reference is True pointer must be True too")
 
     def __cmp__(self, other):
         return (
-                # First make sure we have two Types of the same type (no pun intended!)
-                cmp(type(self), type(other)) or
-                cmp(self.pointer, other.pointer) or
-                cmp(self.reference, other.reference)
+            # First make sure we have two Types of the same type (no pun intended!)
+            cmp(type(self), type(other)) or
+            cmp(self.pointer, other.pointer) or
+            cmp(self.reference, other.reference)
         )
 
     @staticmethod
     def decodeflags(byte):
         """
         Given |byte|, an unsigned uint8 containing flag bits,
         decode the flag bits as described in
         http://www.mozilla.org/scriptable/typelib_file.html#TypeDescriptor
@@ -240,18 +240,18 @@ class SimpleType(Type):
     _cache = {}
 
     def __init__(self, tag, **kwargs):
         Type.__init__(self, **kwargs)
         self.tag = tag
 
     def __cmp__(self, other):
         return (
-                Type.__cmp__(self, other) or
-                cmp(self.tag, other.tag)
+            Type.__cmp__(self, other) or
+            cmp(self.tag, other.tag)
         )
 
     @staticmethod
     def get(data, tag, flags):
         """
         Get a SimpleType object representing |data| (a TypeDescriptorPrefix).
         May return an already-created object. If no cached object is found,
         construct one with |tag| and |flags|.
@@ -292,20 +292,20 @@ class InterfaceType(Type):
         if not pointer:
             raise DataError("InterfaceType is not valid with pointer=False")
         Type.__init__(self, pointer=pointer, **kwargs)
         self.iface = iface
         self.tag = Type.Tags.Interface
 
     def __cmp__(self, other):
         return (
-                Type.__cmp__(self, other) or
-                # When comparing interface types, only look at the name.
-                cmp(self.iface.name, other.iface.name) or
-                cmp(self.tag, other.tag)
+            Type.__cmp__(self, other) or
+            # When comparing interface types, only look at the name.
+            cmp(self.iface.name, other.iface.name) or
+            cmp(self.tag, other.tag)
         )
 
     @staticmethod
     def read(typelib, map, data_pool, offset, flags):
         """
         Read an InterfaceTypeDescriptor at |offset| from the mmaped
         file |map| with data pool offset |data_pool|.
         Returns (InterfaceType, next offset),
@@ -354,19 +354,19 @@ class InterfaceIsType(Type):
         if not pointer:
             raise DataError("InterfaceIsType is not valid with pointer=False")
         Type.__init__(self, pointer=pointer, **kwargs)
         self.param_index = param_index
         self.tag = Type.Tags.InterfaceIs
 
     def __cmp__(self, other):
         return (
-                Type.__cmp__(self, other) or
-                cmp(self.param_index, other.param_index) or
-                cmp(self.tag, other.tag)
+            Type.__cmp__(self, other) or
+            cmp(self.param_index, other.param_index) or
+            cmp(self.tag, other.tag)
         )
 
     @staticmethod
     def read(typelib, map, data_pool, offset, flags):
         """
         Read an InterfaceIsTypeDescriptor at |offset| from the mmaped
         file |map| with data pool offset |data_pool|.
         Returns (InterfaceIsType, next offset),
@@ -413,21 +413,21 @@ class ArrayType(Type):
         Type.__init__(self, pointer=pointer, **kwargs)
         self.element_type = element_type
         self.size_is_arg_num = size_is_arg_num
         self.length_is_arg_num = length_is_arg_num
         self.tag = Type.Tags.Array
 
     def __cmp__(self, other):
         return (
-                Type.__cmp__(self, other) or
-                cmp(self.element_type, other.element_type) or
-                cmp(self.size_is_arg_num, other.size_is_arg_num) or
-                cmp(self.length_is_arg_num, other.length_is_arg_num) or
-                cmp(self.tag, other.tag)
+            Type.__cmp__(self, other) or
+            cmp(self.element_type, other.element_type) or
+            cmp(self.size_is_arg_num, other.size_is_arg_num) or
+            cmp(self.length_is_arg_num, other.length_is_arg_num) or
+            cmp(self.tag, other.tag)
         )
 
     @staticmethod
     def read(typelib, map, data_pool, offset, flags):
         """
         Read an ArrayTypeDescriptor at |offset| from the mmaped
         file |map| with data pool offset |data_pool|.
         Returns (ArrayType, next offset),
@@ -472,20 +472,20 @@ class StringWithSizeType(Type):
             raise DataError("StringWithSizeType is not valid with pointer=False")
         Type.__init__(self, pointer=pointer, **kwargs)
         self.size_is_arg_num = size_is_arg_num
         self.length_is_arg_num = length_is_arg_num
         self.tag = Type.Tags.StringWithSize
 
     def __cmp__(self, other):
         return (
-                Type.__cmp__(self, other) or
-                cmp(self.size_is_arg_num, other.size_is_arg_num) or
-                cmp(self.length_is_arg_num, other.length_is_arg_num) or
-                cmp(self.tag, other.tag)
+            Type.__cmp__(self, other) or
+            cmp(self.size_is_arg_num, other.size_is_arg_num) or
+            cmp(self.length_is_arg_num, other.length_is_arg_num) or
+            cmp(self.tag, other.tag)
         )
 
     @staticmethod
     def read(typelib, map, data_pool, offset, flags):
         """
         Read an StringWithSizeTypeDescriptor at |offset| from the mmaped
         file |map| with data pool offset |data_pool|.
         Returns (StringWithSizeType, next offset),
@@ -528,20 +528,20 @@ class WideStringWithSizeType(Type):
             raise DataError("WideStringWithSizeType is not valid with pointer=False")
         Type.__init__(self, pointer=pointer, **kwargs)
         self.size_is_arg_num = size_is_arg_num
         self.length_is_arg_num = length_is_arg_num
         self.tag = Type.Tags.WideStringWithSize
 
     def __cmp__(self, other):
         return (
-                Type.__cmp__(self, other) or
-                cmp(self.size_is_arg_num, other.size_is_arg_num) or
-                cmp(self.length_is_arg_num, other.length_is_arg_num) or
-                cmp(self.tag, other.tag)
+            Type.__cmp__(self, other) or
+            cmp(self.size_is_arg_num, other.size_is_arg_num) or
+            cmp(self.length_is_arg_num, other.length_is_arg_num) or
+            cmp(self.tag, other.tag)
         )
 
     @staticmethod
     def read(typelib, map, data_pool, offset, flags):
         """
         Read an WideStringWithSizeTypeDescriptor at |offset| from the mmaped
         file |map| with data pool offset |data_pool|.
         Returns (WideStringWithSizeType, next offset),
@@ -590,23 +590,23 @@ class Param(object):
         self.out = out
         self.retval = retval
         self.shared = shared
         self.dipper = dipper
         self.optional = optional
 
     def __cmp__(self, other):
         return (
-                cmp(self.type, other.type) or
-                cmp(self.in_, other.in_) or
-                cmp(self.out, other.out) or
-                cmp(self.retval, other.retval) or
-                cmp(self.shared, other.shared) or
-                cmp(self.dipper, other.dipper) or
-                cmp(self.optional, other.optional)
+            cmp(self.type, other.type) or
+            cmp(self.in_, other.in_) or
+            cmp(self.out, other.out) or
+            cmp(self.retval, other.retval) or
+            cmp(self.shared, other.shared) or
+            cmp(self.dipper, other.dipper) or
+            cmp(self.optional, other.optional)
         )
 
     @staticmethod
     def decodeflags(byte):
         """
         Given |byte|, an unsigned uint8 containing flag bits,
         decode the flag bits as described in
         http://www.mozilla.org/scriptable/typelib_file.html#ParamDescriptor
@@ -723,26 +723,26 @@ class Method(object):
         self.implicit_jscontext = implicit_jscontext
         self.params = list(params)
         if result and not isinstance(result, Param):
             raise Exception("result must be a Param!")
         self.result = result
 
     def __cmp__(self, other):
         return (
-                cmp(self.name, other.name) or
-                cmp(self.getter, other.getter) or
-                cmp(self.setter, other.setter) or
-                cmp(self.notxpcom, other.notxpcom) or
-                cmp(self.constructor, other.constructor) or
-                cmp(self.hidden, other.hidden) or
-                cmp(self.optargc, other.optargc) or
-                cmp(self.implicit_jscontext, other.implicit_jscontext) or
-                cmp(sorted(self.params), sorted(other.params)) or
-                cmp(self.result, other.result)
+            cmp(self.name, other.name) or
+            cmp(self.getter, other.getter) or
+            cmp(self.setter, other.setter) or
+            cmp(self.notxpcom, other.notxpcom) or
+            cmp(self.constructor, other.constructor) or
+            cmp(self.hidden, other.hidden) or
+            cmp(self.optargc, other.optargc) or
+            cmp(self.implicit_jscontext, other.implicit_jscontext) or
+            cmp(sorted(self.params), sorted(other.params)) or
+            cmp(self.result, other.result)
         )
 
     def read_params(self, typelib, map, data_pool, offset, num_args):
         """
         Read |num_args| ParamDescriptors representing this Method's arguments
         from the mmaped file |map| with data pool at the offset |data_pool|,
         starting at |offset| into self.params. Returns the offset
         suitable for reading the data following the ParamDescriptor array.
@@ -874,19 +874,19 @@ class Constant(object):
     def __init__(self, name, type, value):
         self.name = name
         self._name_offset = 0
         self.type = type
         self.value = value
 
     def __cmp__(self, other):
         return (
-                cmp(self.name, other.name) or
-                cmp(self.type, other.type) or
-                cmp(self.value, other.value)
+            cmp(self.name, other.name) or
+            cmp(self.type, other.type) or
+            cmp(self.value, other.value)
         )
 
     @staticmethod
     def read(typelib, map, data_pool, offset):
         """
         Read a ConstDescriptor at |offset| from the mmaped file |map| with
         data pool offset |data_pool|. Returns (Constant, next offset),
         where |next offset| is an offset suitable for reading the data
@@ -1013,22 +1013,22 @@ class Interface(object):
                 return -1
             else:
                 return 1
         elif self.parent is not None:
             c = cmp(self.parent.name, other.parent.name)
             if c != 0:
                 return c
         return (
-                cmp(sorted(self.methods), sorted(other.methods)) or
-                cmp(sorted(self.constants), sorted(other.constants)) or
-                cmp(self.scriptable, other.scriptable) or
-                cmp(self.function, other.function) or
-                cmp(self.builtinclass, other.builtinclass) or
-                cmp(self.main_process_scriptable_only, other.main_process_scriptable_only)
+            cmp(sorted(self.methods), sorted(other.methods)) or
+            cmp(sorted(self.constants), sorted(other.constants)) or
+            cmp(self.scriptable, other.scriptable) or
+            cmp(self.function, other.function) or
+            cmp(self.builtinclass, other.builtinclass) or
+            cmp(self.main_process_scriptable_only, other.main_process_scriptable_only)
         )
 
     def read_descriptor(self, typelib, map, data_pool):
         offset = self._descriptor_offset
         if offset == 0:
             return
         start = data_pool + offset - 1
         parent, num_methods = Interface._descriptorstart.unpack_from(map, start)