# HG changeset patch # User Peter Sanchez # Date 1496265767 25200 # Wed May 31 14:22:47 2017 -0700 # Node ID 4294008c05634509d548e6d938a5bfbc1799f801 # Parent 0000000000000000000000000000000000000000 Initial commit.. covfefe 0.1a0 diff --git a/.hgignore b/.hgignore new file mode 100644 --- /dev/null +++ b/.hgignore @@ -0,0 +1,11 @@ +syntax:glob +.svn +.hgsvn +.*.swp +**.pyc +*.*~ +.coverage +.coveragerc +dist/ +*.egg-info/ +*.egg diff --git a/BSD-LICENSE b/BSD-LICENSE new file mode 100644 --- /dev/null +++ b/BSD-LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2017, Peter Sanchez +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. + +* Neither the name of the copyright holder nor the names of its + contributors may 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/README.rst b/README.rst new file mode 100644 --- /dev/null +++ b/README.rst @@ -0,0 +1,58 @@ +============================== +covfefe +============================== +:Info: Simple module to convert content to "covfefe" quality +:Version: 0.1a0 +:Author: Peter Sanchez (http://www.petersanchez.com) + +Credit +============ + +Now any Python developer can take their content and improve it to "covfefe" quality with ease. + +`End tweets with style `_ + +`It's a framework `_ + +Nod to Kyle Kelley for his JS library - https://github.com/rgbkrk/covfefe + +Installation +============ + +PIP:: + + pip install pycovfefe + +Basic Manual Install:: + + $ python setup.py build + $ sudo python setup.py install + + +Usage +===== + +Usage -- Python :: + + >>> from confefe import convert + >>> convert('Despite the constant negative press') + u'Despite the constant negative press covfefe' + +Usage -- CLI :: + + $ covfefe Despite the constant negative press + Despite the constant negative press covfefe + +Testing +======= + +To test the library run :: + + $ python tests.py + +Copyright & Warranty +==================== +All documentation, libraries, and sample code are +Copyright 2017 Peter Sanchez . The library +and sample code are made available to you under the terms of the BSD license +which is contained in the included file, BSD-LICENSE. diff --git a/covfefe/__init__.py b/covfefe/__init__.py new file mode 100644 --- /dev/null +++ b/covfefe/__init__.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +from .covfefe import convert + +VERSION = (0, 1, 0, 'alpha', 0) + + +def get_version(): + "Returns a PEP 386-compliant version number from VERSION." + assert len(VERSION) == 5 + assert VERSION[3] in ('alpha', 'beta', 'rc', 'final') + + # Now build the two parts of the version number: + # main = X.Y[.Z] + # sub = .devN - for pre-alpha releases + # | {a|b|c}N - for alpha, beta and rc releases + + parts = 2 if VERSION[2] == 0 else 3 + main = '.'.join(str(x) for x in VERSION[:parts]) + + sub = '' + if VERSION[3] != 'final': + mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c'} + sub = mapping[VERSION[3]] + str(VERSION[4]) + + return str(main + sub) + + +__all__ = ['VERSION', 'convert', 'get_version'] diff --git a/covfefe/covfefe.py b/covfefe/covfefe.py new file mode 100644 --- /dev/null +++ b/covfefe/covfefe.py @@ -0,0 +1,13 @@ +import os +import sys + + +def convert(value): + return u'{0} covfefe'.format(value) + + +def main(): + if len(sys.argv) > 1: + print(convert(' '.join(sys.argv[1:]))) + else: + print('Usage: covfefe ') diff --git a/setup.py b/setup.py new file mode 100644 --- /dev/null +++ b/setup.py @@ -0,0 +1,35 @@ +import os +from setuptools import setup, find_packages + + +if os.path.exists('README.rst'): + long_description = open('README.rst', 'r').read() +else: + long_description = 'See https://bitbucket.org/petersanchez/pycovfefe/' + + +setup( + name='pycovfefe', + version=__import__('covfefe').get_version(), + packages=find_packages(), + description='Python Interface for covfefe caliber content generation.', + author='Peter Sanchez', + author_email='petersanchez@gmail.com', + url='https://bitbucket.org/petersanchez/pycovfefe/', + long_description=long_description, + platforms=['any'], + entry_points={ + 'console_scripts': [ + 'covfefe = covfefe.covfefe:main', + ], + }, + classifiers=[ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Natural Language :: English', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2.7', + ], + include_package_data=True, +) diff --git a/tests.py b/tests.py new file mode 100644 --- /dev/null +++ b/tests.py @@ -0,0 +1,14 @@ +import unittest +from covfefe import convert + + +class CovfefeTest(unittest.TestCase): + def test_convert(self): + self.assertEqual( + convert(u'Despite the constant negative press'), + u'Despite the constant negative press covfefe', + ) + + +if __name__ == '__main__': + unittest.main()