pip-log.txt
*.py[oc]
*.egg-info
+.tox/
+.coverage
+.coverage_html
+*.un~
+docs/_build/*
+.env/
+build/
+dist/
-node_modules/
-node_modules/*
-npm-debug.log
-*.sass-cache
-lib-cov
-test/*.log
-test/fixtures/*.json
-test/fixtures/logs/*.log
-
-tmp
-var
+tmp/
+var/
# Financial Crisis Haiku
+A website dedicated to the poetry of financial disaster~
+
+
## Install
-As usual:
+First up, `virtualenv`:
+
+ virtualenv --no-site-packages --distribute .env
+ . .env/bin/activate
+
+Then install the egg:
pip install -e .
-Once that's done, go find tha PyHyphen package directory and copy etc/hyph_en_US.dic into it.
-Unfortunately, OpenOffice.org has 404'd their dictionary files, so we have to do this manually.
+
+**OPTIONAL**
+
+This isn't needed to hack on the site.
+
+If you want to run the haiku-finder yourself, you'll need to deal with PyHyphen.
+Unfotunately, it attempts to download a dictionary file from OpenOffice.org, and
+they appear to have 404'd it.
+
+If we list PyHyphen as a dependency directly the whole chain will fail. But it
+turns out the install works fine by itself, even though you'll get a messy error
+about the missing dictionaries.
+
+ pip install PyHyphen
+
+Finally, let's fix the missing dict (which I dug up from somewhere).
+
+ cp etc/hyph_en_US.dic .env/lib/python2.7/site-packages/hyphen/
## Features
#!/usr/bin/env python
# -*- coding: utf-8 -*-
+""" crisishaiku.com -- a website dedicated to the poetry of financial disaster
+"""
__version__ = '0.0.1'
VERSION = tuple(map(int, __version__.split('.')))
+
+from flask import (Flask,
+ request, session, g, redirect, url_for,
+ abort, render_template, flash, )
+from flaskext.sqlalchemy import SQLAlchemy
+
+
+app = Flask('crisishaiku')
+
+### Config
+# Load from any ALL_CAPS variables in this file
+app.config.from_object('crisishaiku')
+# Load from our base config file
+app.config.from_pyfile('etc/flask.cfg')
+# Load any overrides from the file specified in the env var FLASK_SETTINGS
+app.config.from_envvar('FLASK_SETTINGS', silent=True)
+
+db = SQLAlchemy(app)
+
+
+
--- /dev/null
+DEBUG = True
+SQLALCHEMY_ECHO = True
--- /dev/null
+DEBUG = False
+SQLALCHEMY_ECHO = False
--- /dev/null
+SQLALCHEMY_DATABASE_URI = 'sqlite:///var/haikus.db'
+
-#!/usr/bin/env python
+#!python
# -*- coding: utf-8 -*-
-from setuptools import setup, find_packages
+import re
from os.path import dirname, abspath, join
-
-from crisishaiku import __version__
+from setuptools import setup, find_packages
HERE = abspath(dirname(__file__))
readme = open(join(HERE, 'README.md'), 'rU').read()
+package_file = open(join(HERE, 'crisishaiku/__init__.py'), 'rU')
+__version__ = re.sub(
+ r".*\b__version__\s+=\s+'([^']+)'.*$",
+ r'\1',
+ [ line.strip() for line in package_file if '__version__' in line ].pop(0)
+)
+
setup(
name = 'crisishaiku',
version = __version__,
- description = 'crisishaiku.com website',
+ description = 'a website dedicated to the poetry of financial disaster',
long_description = readme,
url = 'http://crisishaiku.com/',
# entry_points = { 'console_scripts':['crisishaiku = crisishaiku:CrisisHaiku.main'] },
install_requires = [
- 'PyHyphen >= 1.0beta1',
- 'jsonlib2 >= 1.5.2',
- 'anyjson >= 0.3.1',
- 'bunch >= 1.0',
- 'PyYAML >= 3.10',
+ # 'PyHyphen >= 1.0beta1',
+ 'bunch >= 1.0',
+ 'jsonlib2 >= 1.5.2',
+ 'anyjson >= 0.3.1',
+ 'PyYAML >= 3.10',
+
+ 'Flask >= 0.8',
+ 'Flask-SQLAlchemy >= 0.15',
+
+ 'pyjade >= 0.6',
+ 'pystache >= 0.3.1',
],
keywords = 'crisishaiku crisis haiku poetry web',
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
- "Topic :: Utilities"
+ "Topic :: Utilities",
"Topic :: Software Development :: Libraries :: Python Modules",
"Programming Language :: Python",
"Programming Language :: Python :: 2.6",