Permalink
Browse files

initial commit

  • Loading branch information...
0 parents commit ba4ebf111ffb86f9bdc4ee2e9c990b0c146e6f52 @eleddy eleddy committed Jan 11, 2012
Showing with 626 additions and 0 deletions.
  1. +6 −0 .gitignore
  2. +97 −0 .installed.cfg
  3. +32 −0 README.rst
  4. +132 −0 bootstrap.py
  5. +73 −0 buildout.cfg
  6. +58 −0 etc/deploy.ini.in
  7. +40 −0 setup.py
  8. +1 −0 src/.gitignore
  9. +26 −0 src/noiselist/__init__.py
  10. +129 −0 src/noiselist/script.py
  11. +32 −0 src/noiselist/tests.py
@@ -0,0 +1,6 @@
+*~
+buildout-cache
+develop-eggs
+var
+parts
+bin
@@ -0,0 +1,97 @@
+[buildout]
+installed_develop_eggs = /Users/eleddy/buildouts/flask-noiselist/develop-eggs/noiselist.egg-link
+parts = app mkdirs deploy_ini deploy_cfg debug_ini debug_cfg test
+
+[app]
+__buildout_installed__ = /Users/eleddy/buildouts/flask-noiselist/bin/flask-ctl
+ /Users/eleddy/buildouts/flask-noiselist/bin/paster
+ /Users/eleddy/buildouts/flask-noiselist/bin/python-console
+__buildout_signature__ = zc.recipe.egg-1.3.2-py2.6.egg distribute-0.6.24-py2.6.egg zc.buildout-1.5.2-py2.6.egg
+_b = /Users/eleddy/buildouts/flask-noiselist/bin
+_d = /Users/eleddy/buildouts/flask-noiselist/develop-eggs
+_e = /Users/eleddy/.buildout/eggs
+bin-directory = /Users/eleddy/buildouts/flask-noiselist/bin
+develop-eggs-directory = /Users/eleddy/buildouts/flask-noiselist/develop-eggs
+eggs = noiselist
+ Paste
+ PasteScript
+ PasteDeploy
+eggs-directory = /Users/eleddy/.buildout/eggs
+executable = /usr/local/bin/python
+interpreter = python-console
+python = buildout
+recipe = zc.recipe.egg
+
+[mkdirs]
+__buildout_installed__ =
+__buildout_signature__ = z3c.recipe.mkdir-0.3.1-py2.6.egg zc.buildout-1.5.2-py2.6.egg distribute-0.6.24-py2.6.egg
+path = /Users/eleddy/buildouts/flask-noiselist
+ /Users/eleddy/buildouts/flask-noiselist/var/log
+paths = /Users/eleddy/buildouts/flask-noiselist
+ /Users/eleddy/buildouts/flask-noiselist/var/log
+recipe = z3c.recipe.mkdir
+
+[deploy_ini]
+__buildout_installed__ = /Users/eleddy/buildouts/flask-noiselist/parts/etc
+ /Users/eleddy/buildouts/flask-noiselist/parts/etc/deploy.ini
+__buildout_signature__ = collective.recipe.template-1.9-py2.6.egg zc.buildout-1.5.2-py2.6.egg distribute-0.6.24-py2.6.egg
+app = noiselist
+input = etc/deploy.ini.in
+max_requests = 100
+outfile = deploy.ini
+output = /Users/eleddy/buildouts/flask-noiselist/parts/etc/deploy.ini
+recipe = collective.recipe.template
+spawn_if_under = 5
+workers = 10
+
+[deploy_cfg]
+__buildout_installed__ = /Users/eleddy/buildouts/flask-noiselist/parts/etc/deploy.cfg
+__buildout_signature__ = collective.recipe.template-1.9-py2.6.egg zc.buildout-1.5.2-py2.6.egg distribute-0.6.24-py2.6.egg
+input = inline:
+ # Deployment configuration
+ DEBUG = False
+ SECRET_KEY = 'production key'
+ USERNAME = 'Fernand'
+output = /Users/eleddy/buildouts/flask-noiselist/parts/etc/deploy.cfg
+recipe = collective.recipe.template
+
+[debug_ini]
+__buildout_installed__ = /Users/eleddy/buildouts/flask-noiselist/parts/etc/debug.ini
+__buildout_signature__ = collective.recipe.template-1.9-py2.6.egg zc.buildout-1.5.2-py2.6.egg distribute-0.6.24-py2.6.egg
+app = noiselist#debug
+input = etc/deploy.ini.in
+max_requests = 0
+outfile = debug.ini
+output = /Users/eleddy/buildouts/flask-noiselist/parts/etc/debug.ini
+recipe = collective.recipe.template
+spawn_if_under = 1
+workers = 1
+
+[debug_cfg]
+__buildout_installed__ = /Users/eleddy/buildouts/flask-noiselist/parts/etc/debug.cfg
+__buildout_signature__ = collective.recipe.template-1.9-py2.6.egg zc.buildout-1.5.2-py2.6.egg distribute-0.6.24-py2.6.egg
+input = inline:
+ # Debugging configuration
+ DEBUG = True
+ SECRET_KEY = 'development key'
+ USERNAME = 'noiselist'
+output = /Users/eleddy/buildouts/flask-noiselist/parts/etc/debug.cfg
+recipe = collective.recipe.template
+
+[test]
+__buildout_installed__ = /Users/eleddy/buildouts/flask-noiselist/bin/test
+__buildout_signature__ = pbp.recipe.noserunner-0.2.6-py2.6.egg zc.recipe.egg-1.3.2-py2.6.egg nose-1.1.2-py2.6.egg zc.buildout-1.5.2-py2.6.egg distribute-0.6.24-py2.6.egg zc.buildout-1.5.2-py2.6.egg
+_b = /Users/eleddy/buildouts/flask-noiselist/bin
+_d = /Users/eleddy/buildouts/flask-noiselist/develop-eggs
+_e = /Users/eleddy/.buildout/eggs
+bin-directory = /Users/eleddy/buildouts/flask-noiselist/bin
+defaults = -v
+develop-eggs-directory = /Users/eleddy/buildouts/flask-noiselist/develop-eggs
+eggs = noiselist
+ nose
+eggs-directory = /Users/eleddy/.buildout/eggs
+executable = /usr/local/bin/python
+location = /Users/eleddy/buildouts/flask-noiselist/parts/test
+python = buildout
+recipe = pbp.recipe.noserunner
+script = /Users/eleddy/buildouts/flask-noiselist/bin/test
@@ -0,0 +1,32 @@
+Introduction
+------------
+
+This is the second installment of our tour of web frameworks. This will
+be a simple TODO list.
+
+Just like in the last class, you want to run bootstrap and buildout::
+ > git clone <location to repo here>
+ > cd flask-noiselist
+ > python bootstrap.py
+ > ./bin/buildout
+
+To get the server running in foreground mode, do::
+ > bin/flask-ctl debug fg
+
+Your app will be running at http://127.0.0.1:5000 with a simple hello world
+placeholder.
+
+Take a minute to notice the differences between this app and web2py. There is
+no admin console and no formatting by default. Flask is really a micro framwork.
+Notice as well that starting we are in foreground more, and that you don't
+have to kill a process or terminal to restart. Simply Ctl-C.
+
+
+
+
+
+
+
+More Info
+---------
+For more info on this buildout itself, please see http://flask.pocoo.org/snippets/27/
@@ -0,0 +1,132 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+"""
+
+import os, shutil, sys, tempfile, urllib2
+from optparse import OptionParser
+
+tmpeggs = tempfile.mkdtemp()
+
+is_jython = sys.platform.startswith('java')
+
+if not os.path.exists('./buildout-cache'):
+ os.mkdir('buildout-cache')
+
+if not os.path.exists('./buildout-cache/downloads'):
+ os.mkdir('buildout-cache/downloads')
+
+if not os.path.exists('./buildout-cache/downloads/extends'):
+ os.mkdir('buildout-cache/downloads/extends')
+
+# parsing arguments
+parser = OptionParser()
+parser.add_option("-v", "--version", dest="version",
+ help="use a specific zc.buildout version")
+parser.add_option("-d", "--distribute",
+ action="store_true", dest="distribute", default=False,
+ help="Use Disribute rather than Setuptools.")
+
+parser.add_option("-c", None, action="store", dest="config_file",
+ help=("Specify the path to the buildout configuration "
+ "file to be used."))
+
+options, args = parser.parse_args()
+
+# if -c was provided, we push it back into args for buildout' main function
+if options.config_file is not None:
+ args += ['-c', options.config_file]
+
+options.version="1.5.1"
+if options.version is not None:
+ VERSION = '==%s' % options.version
+else:
+ VERSION = ''
+
+
+# We decided to always use distribute, make sure this is the default for us
+# USE_DISTRIBUTE = options.distribute
+USE_DISTRIBUTE = True
+args = args + ['bootstrap']
+
+to_reload = False
+try:
+ import pkg_resources
+ if not hasattr(pkg_resources, '_distribute'):
+ to_reload = True
+ raise ImportError
+except ImportError:
+ ez = {}
+ if USE_DISTRIBUTE:
+ exec urllib2.urlopen('http://python-distribute.org/distribute_setup.py'
+ ).read() in ez
+ ez['use_setuptools'](to_dir=tmpeggs, download_delay=0, no_fake=True)
+ else:
+ exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+ ).read() in ez
+ ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+ if to_reload:
+ reload(pkg_resources)
+ else:
+ import pkg_resources
+
+if sys.platform == 'win32':
+ def quote(c):
+ if ' ' in c:
+ return '"%s"' % c # work around spawn lamosity on windows
+ else:
+ return c
+else:
+ def quote (c):
+ return c
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+ws = pkg_resources.working_set
+
+if USE_DISTRIBUTE:
+ requirement = 'distribute'
+else:
+ requirement = 'setuptools'
+
+if is_jython:
+ import subprocess
+
+ assert subprocess.Popen([sys.executable] + ['-c', quote(cmd), '-mqNxd',
+ quote(tmpeggs), 'zc.buildout' + VERSION],
+ env=dict(os.environ,
+ PYTHONPATH=
+ ws.find(pkg_resources.Requirement.parse(requirement)).location
+ ),
+ ).wait() == 0
+
+else:
+ assert os.spawnle(
+ os.P_WAIT, sys.executable, quote (sys.executable),
+ '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout' + VERSION,
+ dict(os.environ,
+ PYTHONPATH=
+ ws.find(pkg_resources.Requirement.parse(requirement)).location
+ ),
+ ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout' + VERSION)
+import zc.buildout.buildout
+zc.buildout.buildout.main(args)
+shutil.rmtree(tmpeggs)
@@ -0,0 +1,73 @@
+[buildout]
+
+develop = .
+
+parts =
+ app
+ mkdirs
+ deploy_ini
+ deploy_cfg
+ debug_ini
+ debug_cfg
+ test
+newest = false
+
+[server]
+host = 127.0.0.1
+port = 5000
+logfiles = ${buildout:directory}/var/log
+
+[app]
+recipe = zc.recipe.egg
+eggs = noiselist
+ Paste
+ PasteScript
+ PasteDeploy
+
+interpreter = python-console
+
+[mkdirs]
+recipe = z3c.recipe.mkdir
+paths =
+ ${server:logfiles}
+
+[deploy_ini]
+recipe = collective.recipe.template
+input = etc/deploy.ini.in
+output = ${buildout:parts-directory}/etc/${:outfile}
+outfile = deploy.ini
+app = noiselist
+workers = 10
+spawn_if_under = 5
+max_requests = 100
+
+[debug_ini]
+<= deploy_ini
+outfile = debug.ini
+app = noiselist#debug
+workers = 1
+spawn_if_under = 1
+max_requests = 0
+
+[deploy_cfg]
+recipe = collective.recipe.template
+input = inline:
+ # Deployment configuration
+ DEBUG = False
+ SECRET_KEY = 'production key'
+ USERNAME = 'Fernand'
+output = ${buildout:parts-directory}/etc/deploy.cfg
+
+[debug_cfg]
+recipe = collective.recipe.template
+input = inline:
+ # Debugging configuration
+ DEBUG = True
+ SECRET_KEY = 'development key'
+ USERNAME = 'noiselist'
+output = ${buildout:parts-directory}/etc/debug.cfg
+
+[test]
+recipe = pbp.recipe.noserunner
+eggs = noiselist
+defaults = -v
Oops, something went wrong.

0 comments on commit ba4ebf1

Please sign in to comment.