From 7ef3f2e25e8401f9d8b908e9cde910ec48260aab Mon Sep 17 00:00:00 2001 From: Taehoon Kim Date: Sat, 18 Apr 2015 22:21:27 +0900 Subject: [PATCH] add methods for Client --- README.rst | 2 +- fbchat/__init__.py | 2 +- fbchat/core.py | 42 ++++++++++++++++++++++++++++++++++++++++++ setup.py | 4 ++-- 4 files changed, 46 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 4f8d3db..f4a7db0 100644 --- a/README.rst +++ b/README.rst @@ -14,7 +14,7 @@ fbchat .. image:: https://pypip.in/license/fbchat/badge.svg?style=flat :target: https://pypi.python.org/pypi/fbchat -Facebook Chat(`Messenger `__) for Python. +Facebook Chat (`Messenger `__) for Python. Installation ============ diff --git a/fbchat/__init__.py b/fbchat/__init__.py index 0e8fc9f..7de5559 100644 --- a/fbchat/__init__.py +++ b/fbchat/__init__.py @@ -1,7 +1,7 @@ # -*- coding: UTF-8 -*- """ -Facebook Chat(Messenger) for Python +Facebook Chat (Messenger) for Python """ diff --git a/fbchat/core.py b/fbchat/core.py index 36b5170..7226669 100644 --- a/fbchat/core.py +++ b/fbchat/core.py @@ -7,3 +7,45 @@ Core components for fbchat import requests +import time + +class Client: + """A client for the Facebook Chat (Messenger). + + See http://github.com/carpedm20/fbchat for complete + documentation for the API. + + """ + + def __init__(self, email, password): + """A client for the Facebook Chat (Messenger). + + :param email: Facebook `email` or `id` or `phone number` + :param password: Facebook account password + + import fbchat + chat = fbchat.Client(email, password) + + """ + + if not (email and password): + raise Exception("id and password or config is needed") + + + self.email = email + self.password = password + + def listen(self): + pass + + def getUserId(self): + pass + + def sendMessage(self): + pass + + def sendSticker(self): + pass + + def markAsRead(self): + pass diff --git a/setup.py b/setup.py index 8ebde9e..5f6aea6 100644 --- a/setup.py +++ b/setup.py @@ -43,7 +43,7 @@ setup( author=author, author_email=email, classifiers=[ - 'Development Status :: 4 - Beta', + 'Development Status :: 1 - Planning', 'Intended Audience :: Developers', 'Intended Audience :: Developers', 'Intended Audience :: Information Technology', @@ -64,7 +64,7 @@ setup( 'Topic :: Multimedia :: Graphics :: Presentation', 'Topic :: Software Development :: Libraries :: Python Modules', ], - description="Facebook Chat(Messenger) for Python", + description="Facebook Chat (Messenger) for Python", keywords=["facebook chat fbchat"], include_package_data=True, license=license_content,