Skip to content

Commit

Permalink
Packaged
Browse files Browse the repository at this point in the history
packaged application
  • Loading branch information
ikkebr committed May 20, 2014
1 parent 08604a5 commit ecf28e5
Show file tree
Hide file tree
Showing 11 changed files with 243 additions and 17 deletions.
5 changes: 4 additions & 1 deletion 2048.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,4 +342,7 @@ def curses_main(stdscr, replay=False):
curses_main(stdscr, replay=True)
return

curses.wrapper(curses_main)
def main():
curses.wrapper(curses_main)

main()
14 changes: 14 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
=======
Credits
=======

Development Lead
----------------

* Pablo Martin <pablo@odkq.com>


Contributors
------------

* Henrique Pereira <ikkibr@gmail.com>
104 changes: 104 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
============
Contributing
============

Contributions are welcome, and they are greatly appreciated! Every
little bit helps, and credit will always be given.

You can contribute in many ways:

Types of Contributions
----------------------

Report Bugs
~~~~~~~~~~~

Report bugs at https://github.com/odkq/curses-2048/issues.

If you are reporting a bug, please include:

* Your operating system name and version.
* Any details about your local setup that might be helpful in troubleshooting.
* Detailed steps to reproduce the bug.

Fix Bugs
~~~~~~~~

Look through the GitHub issues for bugs. Anything tagged with "bug"
is open to whoever wants to implement it.

Implement Features
~~~~~~~~~~~~~~~~~~

Look through the GitHub issues for features. Anything tagged with "feature"
is open to whoever wants to implement it.

Write Documentation
~~~~~~~~~~~~~~~~~~~

PyXKCDPass could always use more documentation, whether as part of the
official PyXKCDPass docs, in docstrings, or even on the web in blog posts,
articles, and such.

Submit Feedback
~~~~~~~~~~~~~~~

The best way to send feedback is to file an issue at https://github.com/odkq/curses-2048/issues.

If you are proposing a feature:

* Explain in detail how it would work.
* Keep the scope as narrow as possible, to make it easier to implement.
* Remember that this is a volunteer-driven project, and that contributions
are welcome :)

Get Started!
------------

Ready to contribute? Here's how to set up `curses-2048` for local development.

1. Fork the `curses-2048` repo on GitHub.
2. Clone your fork locally::

$ git clone git@github.com:your_name_here/curses-2048.git

3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::

$ mkvirtualenv curses-2048
$ cd curses-2048/
$ python setup.py develop

4. Create a branch for local development::

$ git checkout -b name-of-your-bugfix-or-feature
Now you can make your changes locally.

5. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox::

$ flake8 curses-2048 tests
$ python setup.py test
$ tox

To get flake8 and tox, just pip install them into your virtualenv.

6. Commit your changes and push your branch to GitHub::

$ git add .
$ git commit -m "Your detailed description of your changes."
$ git push origin name-of-your-bugfix-or-feature

7. Submit a pull request through the GitHub website.

Pull Request Guidelines
-----------------------

Before you submit a pull request, check that it meets these guidelines:

1. The pull request should include tests.
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
3. The pull request should work for Python 2.6, 2.7, and 3.3, and for PyPy. Check
https://travis-ci.org/odkq/curses-2048/pull_requests
and make sure that the tests pass for all supported Python versions.
9 changes: 9 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. :changelog:
History
-------

1.0 (2014-05-20)
++++++++++++++++++

* First release as a module.
14 changes: 14 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Copyright (C) 2014 Pablo Martin <pablo@odkq.com>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
11 changes: 11 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
include AUTHORS.rst
include CONTRIBUTING.rst
include HISTORY.rst
include LICENSE
include README.rst

recursive-include tests *
recursive-exclude * __pycache__
recursive-exclude * *.py[co]

recursive-include docs *.rst conf.py Makefile make.bat
16 changes: 0 additions & 16 deletions README.md

This file was deleted.

29 changes: 29 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
===============================
curses-2048
===============================


.. image:: http://i.imgur.com/S4F4wgW.png


A terminal/ncurses/python version of the original game at http://gabrielecirulli.github.io/2048

* Free software: GPL license

Install
--------

Open your terminal and type:

** pip install curses-2048

or

** easy_install curses-2048

Usage
--------

** curses-2048

Use the cursor keys to move and join tiles. Get to the 2048 tile!
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[wheel]
universal = 1
47 changes: 47 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import sys


try:
from setuptools import setup
except ImportError:
from distutils.core import setup


if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()

readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')

setup(
name='curses-2048',
version='0.2.0',
description='2048 implementation with python and ncurses',
long_description=readme + '\n\n' + history,
author='Pablo Martin <>',
author_email='pablo@odkq.com',
url='https://github.com/odkq/curses-2048/',
py_modules = ['curses-2048'],
include_package_data=True,
install_requires=[
],
license="GPL",
zip_safe=False,
keywords='pyxkcdpass',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
],
test_suite='tests',
entry_points={'console_scripts': ['curses-2048 = curses-2048:main']}
)
9 changes: 9 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[tox]
envlist = py26, py27, py33

[testenv]
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/curses-2048
commands = python setup.py test
deps =
-r{toxinidir}/requirements.txt

0 comments on commit ecf28e5

Please sign in to comment.