1010"""
1111
1212
13- from ._conf import PYTHON3
14-
15- if PYTHON3 :
16- # cmp function is gone in Python 3.
17- # Define for backward compatibility
18- def cmp (a , b ):
19- return (a > b ) - (a < b )
13+ def cmp (a , b ):
14+ return (a > b ) - (a < b )
2015
2116
2217class Channel (object ):
2318 # TODO
2419 # updated the properties data structure by splitting it into 2 dict
25-
20+
2621 # All the attributes are private and read only in an attempt to make the channel object immutable
2722 Name = property (lambda self : self .__Name )
2823 Owner = property (lambda self : self .__Owner )
@@ -42,7 +37,7 @@ def __init__(self, name, owner, properties=None, tags=None):
4237 self .__Owner = str (owner ).strip ()
4338 self .Properties = properties
4439 self .Tags = tags
45-
40+
4641 ## TODO don't recreate the dictionary with every get
4742 def getProperties (self ):
4843 """
@@ -85,10 +80,10 @@ def __init__(self, name, owner, value=None):
8580 self .Value = value
8681 if self .Value :
8782 str (value ).strip ()
88-
89- def __cmp__ (self , * arg , ** kwargs ):
83+
84+ def __cmp__ (self , * arg , ** kwargs ):
9085 if arg [0 ] is None :
91- return 1
86+ return 1
9287 return cmp ((self .Name , self .Value ), (arg [0 ].Name , arg [0 ].Value ))
9388
9489
@@ -99,7 +94,7 @@ def __init__(self, name, owner):
9994 """
10095 self .Name = str (name ).strip ()
10196 self .Owner = str (owner ).strip ()
102-
97+
10398 def __cmp__ (self , * arg , ** kwargs ):
10499 if arg [0 ] is None :
105100 return 1
0 commit comments