From a81fff0211ddb2f1150928bf023106dece873e02 Mon Sep 17 00:00:00 2001 From: Taehoon Kim Date: Sat, 18 Apr 2015 21:55:56 +0900 Subject: [PATCH] first commit --- .gitignore | 23 ++++++++++++++ LICENSE.txt | 28 ++++++++++++++++ MANIFEST.in | 4 +++ README.rst | 32 +++++++++++++++++++ fbchat/__init__.py | 38 ++++++++++++++++++++++ fbchat/core.py | 9 ++++++ setup.py | 79 ++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 213 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE.txt create mode 100644 MANIFEST.in create mode 100644 README.rst create mode 100644 fbchat/__init__.py create mode 100644 fbchat/core.py create mode 100644 setup.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5b3da8d --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +*py[co] + +#test +*.sh + +# Packages +*.egg +*.egg-info +dist +build +eggs +parts +bin +var +sdist +develop-eggs +.installed.cfg + +# Vim +.*.sw[op] + +# Sphinx documentation +docs/_build/ diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..73f2dde --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,28 @@ +New BSD License + +Copyright (c) 2015, Taehoon Kim +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* The names of its contributors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..8f0b06d --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,4 @@ +include LICENSE.txt +include MANIFEST.in +include README.rst +include setup.py diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..4f8d3db --- /dev/null +++ b/README.rst @@ -0,0 +1,32 @@ +====== +fbchat +====== + +.. image:: https://pypip.in/v/fbchat/badge.png?style=flat + :target: https://pypi.python.org/pypi/fbchat + +.. image:: https://pypip.in/d/fbchat/badge.png?style=flat + :target: https://pypi.python.org/pypi/fbchat + +.. image:: https://pypip.in/status/fbchat/badge.svg?style=flat + :target: https://pypi.python.org/pypi/fbchat + +.. image:: https://pypip.in/license/fbchat/badge.svg?style=flat + :target: https://pypi.python.org/pypi/fbchat + +Facebook Chat(`Messenger `__) for Python. + +Installation +============ + +Via pip: + +.. code-block:: console + + $ pip install fbchat + + +Authors +======= + +Taehoon Kim / `@carpedm20 `__ diff --git a/fbchat/__init__.py b/fbchat/__init__.py new file mode 100644 index 0000000..0e8fc9f --- /dev/null +++ b/fbchat/__init__.py @@ -0,0 +1,38 @@ +# -*- coding: UTF-8 -*- + +""" +Facebook Chat(Messenger) for Python +""" + + +from .core import * + + +__version__ = '0.0.1' +__author__ = 'Taehoon Kim' +__email__ = 'carpedm20@gmail.com' +__source__ = 'https://github.com/carpedm20/fbchat/' +__license__ = ''' +New BSD License +Copyright (c) 2015, Taehoon Kim +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* The names of its contributors may not be used to endorse or promote products + derived from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +''' diff --git a/fbchat/core.py b/fbchat/core.py new file mode 100644 index 0000000..36b5170 --- /dev/null +++ b/fbchat/core.py @@ -0,0 +1,9 @@ +# -*- coding: UTF-8 -*- + + +""" +Core components for fbchat +""" + + +import requests diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..8ebde9e --- /dev/null +++ b/setup.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python + + +""" +Setup script for fbchat +""" + + +import os +try: + from setuptools import setup +except ImportError: + from distutils.core import setup + + +with open('README.rst') as f: + readme_content = f.read().strip() + + +with open('LICENSE.txt') as f: + license_content = f.read().strip() + + +version = None +author = None +email = None +source = None +with open(os.path.join('fbchat', '__init__.py')) as f: + for line in f: + if line.strip().startswith('__version__'): + version = line.split('=')[1].strip().replace('"', '').replace("'", '') + elif line.strip().startswith('__author__'): + author = line.split('=')[1].strip().replace('"', '').replace("'", '') + elif line.strip().startswith('__email__'): + email = line.split('=')[1].strip().replace('"', '').replace("'", '') + elif line.strip().startswith('__source__'): + source = line.split('=')[1].strip().replace('"', '').replace("'", '') + elif None not in (version, author, email, source): + break + +setup( + name='fbchat', + author=author, + author_email=email, + classifiers=[ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: Developers', + 'Intended Audience :: Information Technology', + 'License :: OSI Approved :: BSD License', + 'License :: OSI Approved :: BSD License', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.2', + 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: Implementation :: CPython', + 'Programming Language :: Python :: Implementation :: PyPy', + 'Programming Language :: Python', + 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', + 'Topic :: Multimedia :: Graphics :: Presentation', + 'Topic :: Software Development :: Libraries :: Python Modules', + ], + description="Facebook Chat(Messenger) for Python", + keywords=["facebook chat fbchat"], + include_package_data=True, + license=license_content, + long_description=readme_content, + packages=['fbchat'], + install_requires=[ + 'requests' + ], + url=source, + version=version, + zip_safe=True, +)