Skip to content

Commit

Permalink
Added **kwargs to all Insta Objects
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwickerhf committed Jan 19, 2021
1 parent eb74bed commit f07066a
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion instaclient/instagram/address.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from instaclient.client.instaclient import InstaClient

class Address():
def __init__(self, address:str):
def __init__(self, address:str, **kwargs):
try:
data = json.loads(address)
self.street_address = data.get('street_address')
Expand Down
1 change: 1 addition & 0 deletions instaclient/instagram/comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def __init__(self,
viewer_has_liked:bool=None,
parent_comment:'Comment'=None,
threaded_comments:List['Comment']=None,
**kwargs
):
super().__init__(client, id, type=InstaBaseObject.GRAPH_COMMENT, viewer=viewer)
# REQUIRED
Expand Down
3 changes: 2 additions & 1 deletion instaclient/instagram/hashtag.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ def __init__(self,
posts_count:int=None,
allow_following:bool=None,
is_top_media_only:bool=None,
is_following:bool=None
is_following:bool=None,
**kwargs
):
super().__init__(client, id, InstaBaseObject.GRAPH_HASHTAG, viewer)
self.name = name
Expand Down
2 changes: 1 addition & 1 deletion instaclient/instagram/instaobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class InstaBaseObject(abc.ABC):
GRAPH_MENTION = 'GraphMentionStory'
GRAPH_COMMENT = 'GraphCommentMediaStory'

def __init__(self, client:'InstaClient', id:str, type:str, viewer:str=None):
def __init__(self, client:'InstaClient', id:str, type:str, viewer:str=None, **kwargs):
"""Base class for most Instagram objects
The base condition for two InstaBaseObjects to be equal is if they share
Expand Down
1 change: 1 addition & 0 deletions instaclient/instagram/location.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def __init__(self,
primary_alias_on_fb:str=None,
phone:str=None,
address:Address=None,
**kwargs
):
super().__init__(client, id, InstaBaseObject.GRAPH_LOCATION, viewer=viewer)
self.name = name
Expand Down
2 changes: 1 addition & 1 deletion instaclient/instagram/notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


class Notification(InstaBaseObject):
def __init__(self, client, id:str, viewer:str, from_user:Profile, type:str, timestamp):
def __init__(self, client, id:str, viewer:str, from_user:Profile, type:str, timestamp, **kwargs):
super().__init__(client, id, type, viewer)
# Required
self.from_user = from_user
Expand Down
1 change: 1 addition & 0 deletions instaclient/instagram/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def __init__(self,
viewer_has_saved_to_collection:bool=None,
viewer_in_photo_of_you:bool=None,
viewer_can_reshare:bool=None,
**kwargs
):
super().__init__(id=id, type=type, viewer=viewer, client=client)
# Required
Expand Down
2 changes: 1 addition & 1 deletion instaclient/instagram/postmedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self,
has_audio:Optional[bool]=None,
video_duration:Optional[float]=None,
video_view_count:Optional[int]=None,

**kwargs
) -> None:
super().__init__(client, id, type, viewer)
self.shortcode = shortcode
Expand Down
1 change: 1 addition & 0 deletions instaclient/instagram/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ def __init__(self,
has_requested_viewer:bool=None,
mutual_followed:bool=None,
requested_by_viewer:bool=None,
**kwargs
):
super().__init__(client, id, self.GRAPH_PROFILE, viewer)
# Required
Expand Down

0 comments on commit f07066a

Please sign in to comment.