Skip to content

Commit eaf9a39

Browse files
committed
Removing commented code blocks.
1 parent 341f844 commit eaf9a39

File tree

1 file changed

+1
-79
lines changed

1 file changed

+1
-79
lines changed

intercom/user.py

Lines changed: 1 addition & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ def _object_entity_key(self):
5050

5151
def deserialize(self):
5252
if self._is_list_type:
53-
# print "SELF %s" % (self._json)
54-
# print "ENTITY KEY %s" % (self._object_entity_key)
55-
# print " JSON %s" % (self._json[self._object_entity_key])
5653
return self.deserialize_collection(self._json[self._object_entity_key])
5754
else:
5855
return self.deserialize_object(self._json)
@@ -63,37 +60,6 @@ def deserialize_collection(self, collection_json):
6360
def deserialize_object(self, object_json):
6461
entity_class = utils.constantize_singular_resource_name(self._object_entity_key)
6562
return entity_class.from_api(object_json)
66-
# return entity_class
67-
# print "deserialize %s:%s:%s" % (name, value, type(value))
68-
69-
# if name[-3:] == "_at":
70-
# if hasattr(value, "timetuple"):
71-
# value = time.mktime(value.timetuple())
72-
# elif hasattr(value, 'keys'):
73-
# print "HAS KEYS [%s:%s]" % (name, value.get('type'))
74-
# if 'type' in value:
75-
# if value['type'][-5:] == '.list':
76-
# res = []
77-
# for item in value[name]:
78-
# obj = Intercom.create_class_instance(name)
79-
# obj.update(item)
80-
# res.append(obj)
81-
# value = res
82-
# else:
83-
# obj = Intercom.create_class_instance(name)
84-
# obj.update(value)
85-
# value = obj
86-
# else:
87-
# print "ELSE NAME %s [%s] [%s]" % (name, self.__class__, value)
88-
# if hasattr(self, 'flat_store_attributes') and name in self.flat_store_attributes:
89-
# value = FlatStore(value)
90-
# else:
91-
# obj = Intercom.create_class_instance(name)
92-
# obj.update(value)
93-
# value = obj
94-
# print "CREATED %s" % (type(value))
95-
# elif type(value) == types.ListType:
96-
# print "LIST ATTR"
9763

9864

9965
def timestamp_field(attribute):
@@ -123,22 +89,7 @@ def to_datetime_value(value):
12389

12490
class Resource(object):
12591

126-
# class __metaclass__(type):
127-
# def __new__(mcs, name, bases, attributes):
128-
# if '__intercom_collection__' not in attributes:
129-
# attributes.update(__intercom_collection__=name.lower() + "s")
130-
# if '__intercom_name__' not in attributes:
131-
# attributes.update(__intercom_name__=name.lower())
132-
# cls = type.__new__(mcs, name, bases, attributes)
133-
# return cls
134-
13592
def __init__(self, **params):
136-
# self.__class__.__intercom_collection__ = self.__class__.__name__.lower() + "s"
137-
# self.__class__.__intercom_name__ = self.__class__.__name__.lower()
138-
# if '__intercom_collection__' not in attributes:
139-
# attributes.update(__intercom_collection__=name.lower() + "s")
140-
# if '__intercom_name__' not in attributes:
141-
# attributes.update(__intercom_name__=name.lower())
14293
self.from_dict(params)
14394

14495
if hasattr(self, 'flat_store_attributes'):
@@ -188,27 +139,6 @@ def __setattr__(self, attribute, value):
188139
else:
189140
value_to_set = value
190141
super(Resource, self).__setattr__(attribute, value_to_set)
191-
# setattr(self, attribute, value_to_set)
192-
193-
# def __setattr__(self, name, value):
194-
# print "SET ATTR %s:%s:%s" % (name, value, type(value))
195-
# # print "setattr", name, value
196-
# if name[-3:] == "_at":
197-
# if hasattr(value, "timetuple"):
198-
# value = time.mktime(value.timetuple())
199-
# elif hasattr(value, 'keys'):
200-
# print "NAME %s [%s] [%s]" % (name, self.__class__, value)
201-
# if hasattr(self, 'flat_store_attributes') and name in self.flat_store_attributes:
202-
# value = FlatStore(value)
203-
# else:
204-
# obj = create_class_instance(name)
205-
# obj.update(value)
206-
# value = obj
207-
# print "CREATED %s" % (type(value))
208-
# elif type(value) == types.ListType:
209-
# print "LIST ATTR"
210-
211-
# super(Resource, self).__setattr__(name, value)
212142

213143

214144
CLASS_REGISTRY = {}
@@ -239,19 +169,11 @@ def increment(self, key, value=1):
239169

240170

241171
class User(Resource, Find, FindAll, All, Count, Save, Delete, IncrementableAttributes):
172+
242173
@property
243174
def flat_store_attributes(self):
244175
return ['custom_attributes']
245176

246-
# __slots__ = [
247-
# 'type', 'id', 'created_at', 'remote_created_at',
248-
# 'updated_at', 'user_id', 'email', 'name', 'custom_attributes',
249-
# 'last_request_at', 'session_count', 'avatar',
250-
# 'unsubscribed_from_emails', 'location_data', 'user_agent_data',
251-
# 'last_seen_ip', 'companies', 'social_profiles', 'segments',
252-
# 'tags'
253-
# ]
254-
255177

256178
class Company(Resource, Find, Count):
257179
pass

0 commit comments

Comments
 (0)