first init of Fotokiste as a TurboGears project

This commit is contained in:
lars 2008-06-08 22:58:23 +00:00
parent e425368450
commit 4cc6b56519
39 changed files with 936 additions and 0 deletions

4
fotokiste/README.txt Normal file
View file

@ -0,0 +1,4 @@
fotokiste
This is a TurboGears (http://www.turbogears.org) project. It can be
started by running the start-fotokiste.py script.

0
fotokiste/__init__.py Normal file
View file

68
fotokiste/dev.cfg Normal file
View file

@ -0,0 +1,68 @@
[global]
# This is where all of your settings go for your development environment
# Settings that are the same for both development and production
# (such as template engine, encodings, etc.) all go in
# fotokiste/config/app.cfg
# DATABASE
# pick the form for your database
# sqlobject.dburi="postgres://username@hostname/databasename"
# sqlobject.dburi="mysql://username:password@hostname:port/databasename"
# sqlobject.dburi="sqlite:///file_name_and_path"
# If you have sqlite, here's a simple default to get you started
# in development
sqlobject.dburi="sqlite://%(current_dir_uri)s/devdata.sqlite"
# if you are using a database or table type without transactions
# (MySQL default, for example), you should turn off transactions
# by prepending notrans_ on the uri
# sqlobject.dburi="notrans_mysql://username:password@hostname:port/databasename"
# for Windows users, sqlite URIs look like:
# sqlobject.dburi="sqlite:///drive_letter:/path/to/file"
# SERVER
# Some server parameters that you may want to tweak
# server.socket_port=8080
# Enable the debug output at the end on pages.
# log_debug_info_filter.on = False
server.environment="development"
autoreload.package="fotokiste"
# Auto-Reload after code modification
# autoreload.on = True
# Set to True if you'd like to abort execution if a controller gets an
# unexpected parameter. False by default
tg.strict_parameters = True
# LOGGING
# Logging configuration generally follows the style of the standard
# Python logging module configuration. Note that when specifying
# log format messages, you need to use *() for formatting variables.
# Deployment independent log configuration is in fotokiste/config/log.cfg
[logging]
[[loggers]]
[[[fotokiste]]]
level='DEBUG'
qualname='fotokiste'
handlers=['debug_out']
[[[allinfo]]]
level='INFO'
handlers=['debug_out']
[[[access]]]
level='INFO'
qualname='turbogears.access'
handlers=['access_out']
propagate=0

View file

@ -0,0 +1,15 @@
Metadata-Version: 1.0
Name: fotokiste
Version: 1.0
Summary: UNKNOWN
Home-page: UNKNOWN
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN
Description: UNKNOWN
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Framework :: TurboGears

View file

@ -0,0 +1,22 @@
README.txt
setup.py
fotokiste/__init__.py
fotokiste/commands.py
fotokiste/controllers.py
fotokiste/json.py
fotokiste/model.py
fotokiste/release.py
fotokiste.egg-info/PKG-INFO
fotokiste.egg-info/SOURCES.txt
fotokiste.egg-info/dependency_links.txt
fotokiste.egg-info/entry_points.txt
fotokiste.egg-info/not-zip-safe
fotokiste.egg-info/paster_plugins.txt
fotokiste.egg-info/requires.txt
fotokiste.egg-info/sqlobject.txt
fotokiste.egg-info/top_level.txt
fotokiste/config/__init__.py
fotokiste/templates/__init__.py
fotokiste/tests/__init__.py
fotokiste/tests/test_controllers.py
fotokiste/tests/test_model.py

View file

@ -0,0 +1 @@

View file

@ -0,0 +1,3 @@
[console_scripts]
start-fotokiste = fotokiste.commands:start

View file

@ -0,0 +1 @@

View file

@ -0,0 +1,2 @@
TurboGears
PasteScript

View file

@ -0,0 +1,2 @@
TurboGears >= 1.0.4.4
SQLObject>=0.8

View file

@ -0,0 +1,2 @@
db_module=fotokiste.model
history_dir=$base/fotokiste/sqlobject-history

View file

@ -0,0 +1 @@
fotokiste

View file

View file

@ -0,0 +1,53 @@
# -*- coding: utf-8 -*-
"""This module contains functions called from console script entry points."""
import sys
from os import getcwd
from os.path import dirname, exists, join
import pkg_resources
pkg_resources.require("TurboGears>=1.0.4.4")
import cherrypy
import turbogears
cherrypy.lowercase_api = True
class ConfigurationError(Exception):
pass
def start():
"""Start the CherryPy application server."""
setupdir = dirname(dirname(__file__))
curdir = getcwd()
# First look on the command line for a desired config file,
# if it's not on the command line, then look for 'setup.py'
# in the current directory. If there, load configuration
# from a file called 'dev.cfg'. If it's not there, the project
# is probably installed and we'll look first for a file called
# 'prod.cfg' in the current directory and then for a default
# config file called 'default.cfg' packaged in the egg.
if len(sys.argv) > 1:
configfile = sys.argv[1]
elif exists(join(setupdir, "setup.py")):
configfile = join(setupdir, "dev.cfg")
elif exists(join(curdir, "prod.cfg")):
configfile = join(curdir, "prod.cfg")
else:
try:
configfile = pkg_resources.resource_filename(
pkg_resources.Requirement.parse("fotokiste"),
"config/default.cfg")
except pkg_resources.DistributionNotFound:
raise ConfigurationError("Could not find default configuration.")
turbogears.update_config(configfile=configfile,
modulename="fotokiste.config")
from fotokiste.controllers import Root
turbogears.start_server(Root())

View file

View file

@ -0,0 +1,66 @@
[global]
# The settings in this file should not vary depending on the deployment
# environment. dev.cfg and prod.cfg are the locations for
# the different deployment settings. Settings in this file will
# be overridden by settings in those other files.
# The commented out values below are the defaults
# VIEW
# which view (template engine) to use if one is not specified in the
# template name
# tg.defaultview = "kid"
# The following kid settings determine the settings used by the kid serializer.
# Kid output method (e.g. html, html-strict, xhtml, xhtml-strict, xml, json)
# and formatting (e.g. default, straight, compact, newlines, wrap, nice)
# kid.outputformat="html default"
# kid.encoding="utf-8"
# The sitetemplate is used for overall styling of a site that
# includes multiple TurboGears applications
# tg.sitetemplate="<packagename.templates.templatename>"
# Allow every exposed function to be called as json,
# tg.allow_json = False
# Suppress the inclusion of the shipped MochiKit version, which is rather outdated.
# Attention: setting this to True and listing 'turbogears.mochikit' in 'tg.include_widgets'
# is a contradiction. This option will overrule the default-inclusion to prevent version
# mismatch bugs.
# tg.mochikit_suppress = True
# List of Widgets to include on every page.
# for example ['turbogears.mochikit']
# tg.include_widgets = []
# Set to True if the scheduler should be started
# tg.scheduler = False
# Set to True to allow paginate decorator redirects when page number gets
# out of bound. Useful for getting the real page id in the url
# paginate.redirect_on_out_of_range = True
# Set to True to allow paginate decorator redirects when last page is requested.
# This is useful for getting the real last page id in the url
# paginate.redirect_on_last_page = True
# Set session or cookie
# session_filter.on = True
# compress the data sends to the web browser
# [/]
# gzip_filter.on = True
# gzip_filter.mime_types = ["application/x-javascript", "text/javascript", "text/html", "text/css", "text/plain"]
[/static]
static_filter.on = True
static_filter.dir = "%(top_level_dir)s/static"
[/favicon.ico]
static_filter.on = True
static_filter.file = "%(top_level_dir)s/static/images/favicon.ico"

View file

@ -0,0 +1,29 @@
# LOGGING
# Logging is often deployment specific, but some handlers and
# formatters can be defined here.
[logging]
[[formatters]]
[[[message_only]]]
format='*(message)s'
[[[full_content]]]
format='*(asctime)s *(name)s *(levelname)s *(message)s'
[[handlers]]
[[[debug_out]]]
class='StreamHandler'
level='DEBUG'
args='(sys.stdout,)'
formatter='full_content'
[[[access_out]]]
class='StreamHandler'
level='INFO'
args='(sys.stdout,)'
formatter='message_only'
[[[error_out]]]
class='StreamHandler'
level='ERROR'
args='(sys.stdout,)'

View file

@ -0,0 +1,13 @@
import turbogears as tg
from turbogears import controllers, expose, flash
# from fotokiste import model
# import logging
# log = logging.getLogger("fotokiste.controllers")
class Root(controllers.RootController):
@expose(template="fotokiste.templates.welcome")
def index(self):
import time
# log.debug("Happy TurboGears Controller Responding For Duty")
flash("Your application is now running")
return dict(now=time.ctime())

View file

@ -0,0 +1,10 @@
# A JSON-based API(view) for your app.
# Most rules would look like:
# @jsonify.when("isinstance(obj, YourClass)")
# def jsonify_yourclass(obj):
# return [obj.val1, obj.val2]
# @jsonify can convert your objects to following types:
# lists, dicts, numbers and strings
from turbojson.jsonify import jsonify

View file

@ -0,0 +1,20 @@
import pkg_resources
pkg_resources.require("SQLObject>=0.8")
from turbogears.database import PackageHub
# import some basic SQLObject classes for declaring the data model
# (see http://www.sqlobject.org/SQLObject.html#declaring-the-class)
from sqlobject import SQLObject, SQLObjectNotFound, RelatedJoin
# import some datatypes for table columns from SQLObject
# (see http://www.sqlobject.org/SQLObject.html#column-types for more)
from sqlobject import StringCol, UnicodeCol, IntCol, DateTimeCol
__connection__ = hub = PackageHub('fotokiste')
# your data model
# class YourDataClass(SQLObject):
# pass

View file

@ -0,0 +1,14 @@
# Release information about fotokiste
version = "1.0"
# description = "Your plan to rule the world"
# long_description = "More description about your plan"
# author = "Your Name Here"
# email = "YourEmail@YourDomain"
# copyright = "Vintage 2006 - a good year indeed"
# if it's open source, you might want to specify these
# url = "http://yourcool.site/"
# download_url = "http://yourcool.site/download"
# license = "MIT"

View file

@ -0,0 +1,134 @@
/*
* Quick mash-up of CSS for the TG quick start page.
*/
html, body {
color: black;
background-color: #ddd;
font: x-small "Lucida Grande", "Lucida Sans Unicode", geneva, verdana, sans-serif;
margin: 0;
padding: 0;
}
td, th {padding:3px;border:none;}
tr th {text-align:left;background-color:#f0f0f0;color:#333;}
tr.odd td {background-color:#edf3fe;}
tr.even td {background-color:#fff;}
#header {
height: 80px;
width: 777px;
background: blue URL('../images/header_inner.png') no-repeat;
border-left: 1px solid #aaa;
border-right: 1px solid #aaa;
margin: 0 auto 0 auto;
}
a.link, a, a.active {
color: #369;
}
#main_content {
color: black;
font-size: 127%;
background-color: white;
width: 757px;
margin: 0 auto 0 auto;
border-left: 1px solid #aaa;
border-right: 1px solid #aaa;
padding: 10px;
}
#sidebar {
border: 1px solid #aaa;
background-color: #eee;
margin: 0.5em;
padding: 1em;
float: right;
width: 200px;
font-size: 88%;
}
#sidebar h2 {
margin-top: 0;
}
#sidebar ul {
margin-left: 1.5em;
padding-left: 0;
}
h1,h2,h3,h4,h5,h6,#getting_started_steps {
font-family: "Century Schoolbook L", Georgia, serif;
font-weight: bold;
}
h2 {
font-size: 150%;
}
#getting_started_steps a {
text-decoration: none;
}
#getting_started_steps a:hover {
text-decoration: underline;
}
#getting_started_steps li {
font-size: 80%;
margin-bottom: 0.5em;
}
#getting_started_steps h2 {
font-size: 120%;
}
#getting_started_steps p {
font: 100% "Lucida Grande", "Lucida Sans Unicode", geneva, verdana, sans-serif;
}
#footer {
border: 1px solid #aaa;
border-top: 0px none;
color: #999;
background-color: white;
padding: 10px;
font-size: 80%;
text-align: center;
width: 757px;
margin: 0 auto 1em auto;
}
.code {
font-family: monospace;
}
span.code {
font-weight: bold;
background: #eee;
}
#status_block {
margin: 0 auto 0.5em auto;
padding: 15px 10px 15px 55px;
background: #cec URL('../images/ok.png') left center no-repeat;
border: 1px solid #9c9;
width: 450px;
font-size: 120%;
font-weight: bolder;
}
.notice {
margin: 0.5em auto 0.5em auto;
padding: 15px 10px 15px 55px;
width: 450px;
background: #eef URL('../images/info.png') left center no-repeat;
border: 1px solid #cce;
}
.fielderror {
color: red;
font-weight: bold;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View file

@ -0,0 +1,114 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://purl.org/kid/ns#">
<head>
<meta content="text/html; charset=UTF-8"
http-equiv="content-type" py:replace="''"/>
<title>Login</title>
<style type="text/css">
#loginBox
{
width: 30%;
margin: auto;
margin-top: 10%;
padding-left: 10%;
padding-right: 10%;
padding-top: 5%;
padding-bottom: 5%;
font-family: verdana;
font-size: 10px;
background-color: #eee;
border: 2px solid #ccc;
}
#loginBox h1
{
font-size: 42px;
font-family: "Trebuchet MS";
margin: 0;
color: #ddd;
}
#loginBox p
{
position: relative;
top: -1.5em;
padding-left: 4em;
font-size: 12px;
margin: 0;
color: #666;
}
#loginBox table
{
table-layout: fixed;
border-spacing: 0;
width: 100%;
}
#loginBox td.label
{
width: 33%;
text-align: right;
}
#loginBox td.field
{
width: 66%;
}
#loginBox td.field input
{
width: 100%;
}
#loginBox td.buttons
{
text-align: right;
}
</style>
</head>
<body>
<div id="loginBox">
<h1>Login</h1>
<p>${message}</p>
<form action="${previous_url}" method="POST">
<table>
<tr>
<td class="label">
<label for="user_name">User Name:</label>
</td>
<td class="field">
<input type="text" id="user_name" name="user_name"/>
</td>
</tr>
<tr>
<td class="label">
<label for="password">Password:</label>
</td>
<td class="field">
<input type="password" id="password" name="password"/>
</td>
</tr>
<tr>
<td colspan="2" class="buttons">
<input type="submit" name="login" value="Login"/>
</td>
</tr>
</table>
<input py:if="forward_url" type="hidden" name="forward_url"
value="${forward_url}"/>
<div py:for="name,values in original_parameters.items()" py:strip="1">
<input py:for="value in isinstance(values, list) and values or [values]"
type="hidden" name="${name}" value="${value}"/>
</div>
</form>
</div>
</body>
</html>

View file

@ -0,0 +1,50 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?python import sitetemplate ?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#"
py:extends="sitetemplate">
<head py:match="item.tag=='{http://www.w3.org/1999/xhtml}head'" py:attrs="item.items()">
<meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
<title py:replace="''">Your title goes here</title>
<meta py:replace="item[:]" name="description" content="master template"/>
<style type="text/css" media="screen">
#pageLogin
{
font-size: 10px;
font-family: verdana;
text-align: right;
}
</style>
<link rel="stylesheet" type="text/css" media="screen" href="../static/css/style.css"
py:attrs="href=tg.url('/static/css/style.css')"/>
</head>
<body py:match="item.tag=='{http://www.w3.org/1999/xhtml}body'" py:attrs="item.items()">
<div py:if="tg.config('identity.on') and not defined('logging_in')" id="pageLogin">
<span py:if="tg.identity.anonymous">
<a href="${tg.url('/login')}">Login</a>
</span>
<span py:if="not tg.identity.anonymous">
Welcome ${tg.identity.user.display_name or tg.identity.user.user_name}.
<a href="${tg.url('/logout')}">Logout</a>
</span>
</div>
<div id="header">&#160;</div>
<div id="main_content">
<div id="status_block" class="flash"
py:if="value_of('tg_flash', None)" py:content="tg_flash"></div>
<div py:replace="[item.text]+item[:]">page content</div>
</div>
<div id="footer">
<img src="${tg.url('/static/images/under_the_hood_blue.png')}"
alt="TurboGears under the hood" />
<p>TurboGears is a open source front-to-back web development framework
written in Python</p>
<p>Copyright &#169; 2007 Kevin Dangoor</p>
</div>
</body>
</html>

View file

@ -0,0 +1,47 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#"
py:extends="'master.kid'">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" py:replace="''"/>
<title>Welcome to TurboGears</title>
</head>
<body>
<div id="sidebar">
<h2>Learn more</h2>
Learn more about TurboGears and take part in its
development
<ul class="links">
<li><a href="http://www.turbogears.org">Official website</a></li>
<li><a href="http://docs.turbogears.org">Documentation</a></li>
<li><a href="http://trac.turbogears.org/turbogears/">Trac
(bugs/suggestions)</a></li>
<li><a href="http://groups.google.com/group/turbogears"> Mailing list</a> </li>
</ul>
<span py:replace="now">now</span>
</div>
<div id="getting_started">
<ol id="getting_started_steps">
<li class="getting_started">
<h3>Model</h3>
<p> <a href="http://docs.turbogears.org/1.0/GettingStarted/DefineDatabase">Design models</a> in the <span class="code">model.py</span>.<br/>
Edit <span class="code">dev.cfg</span> to <a href="http://docs.turbogears.org/1.0/GettingStarted/UseDatabase">use a different backend</a>, or start with a pre-configured SQLite database. <br/>
Use script <span class="code">tg-admin sql create</span> to create the database tables.</p>
</li>
<li class="getting_started">
<h3>View</h3>
<p> Edit <a href="http://docs.turbogears.org/1.0/GettingStarted/Kid">html-like templates</a> in the <span class="code">/templates</span> folder;<br/>
Put all <a href="http://docs.turbogears.org/1.0/StaticFiles">static contents</a> in the <span class="code">/static</span> folder. </p>
</li>
<li class="getting_started">
<h3>Controller</h3>
<p> Edit <span class="code"> controllers.py</span> and <a href="http://docs.turbogears.org/1.0/GettingStarted/CherryPy">build your
website structure</a> with the simplicity of Python objects. <br/>
TurboGears will automatically reload itself when you modify your project. </p>
</li>
</ol>
<div class="notice"> If you create something cool, please <a href="http://groups.google.com/group/turbogears">let people know</a>, and consider contributing something back to the <a href="http://groups.google.com/group/turbogears">community</a>.</div>
</div>
<!-- End of getting_started -->
</body>
</html>

View file

View file

@ -0,0 +1,32 @@
import unittest
import turbogears
from turbogears import testutil
from fotokiste.controllers import Root
import cherrypy
cherrypy.root = Root()
class TestPages(unittest.TestCase):
def setUp(self):
turbogears.startup.startTurboGears()
def tearDown(self):
"""Tests for apps using identity need to stop CP/TG after each test to
stop the VisitManager thread.
See http://trac.turbogears.org/turbogears/ticket/1217 for details.
"""
turbogears.startup.stopTurboGears()
def test_method(self):
"the index method should return a string called now"
import types
result = testutil.call(cherrypy.root.index)
assert type(result["now"]) == types.StringType
def test_indextitle(self):
"The indexpage should have the right title"
testutil.create_request("/")
response = cherrypy.response.body[0].lower()
assert "<title>welcome to turbogears</title>" in response

View file

@ -0,0 +1,22 @@
# If your project uses a database, you can set up database tests
# similar to what you see below. Be sure to set the db_uri to
# an appropriate uri for your testing database. sqlite is a good
# choice for testing, because you can use an in-memory database
# which is very fast.
from turbogears import testutil, database
# from fotokiste.model import YourDataClass, User
# database.set_db_uri("sqlite:///:memory:")
# class TestUser(testutil.DBTest):
# def get_model(self):
# return User
# def test_creation(self):
# "Object creation should set the name"
# obj = User(user_name = "creosote",
# email_address = "spam@python.not",
# display_name = "Mr Creosote",
# password = "Wafer-thin Mint")
# assert obj.display_name == "Mr Creosote"

84
fotokiste/sample-prod.cfg Normal file
View file

@ -0,0 +1,84 @@
[global]
# This is where all of your settings go for your production environment.
# You'll copy this file over to your production server and provide it
# as a command-line option to your start script.
# Settings that are the same for both development and production
# (such as template engine, encodings, etc.) all go in
# fotokiste/config/app.cfg
# DATABASE
# pick the form for your database
# sqlobject.dburi="postgres://username@hostname/databasename"
# sqlobject.dburi="mysql://username:password@hostname:port/databasename"
# sqlobject.dburi="sqlite:///file_name_and_path"
# If you have sqlite, here's a simple default to get you started
# in development
sqlobject.dburi="sqlite://%(current_dir_uri)s/devdata.sqlite"
# if you are using a database or table type without transactions
# (MySQL default, for example), you should turn off transactions
# by prepending notrans_ on the uri
# sqlobject.dburi="notrans_mysql://username:password@hostname:port/databasename"
# for Windows users, sqlite URIs look like:
# sqlobject.dburi="sqlite:///drive_letter:/path/to/file"
# SERVER
server.environment="production"
# Sets the number of threads the server uses
# server.thread_pool = 1
# if this is part of a larger site, you can set the path
# to the TurboGears instance here
# server.webpath=""
# Set to True if you are deploying your App behind a proxy
# e.g. Apache using mod_proxy
# base_url_filter.on = False
# Set to True if your proxy adds the x_forwarded_host header
# base_url_filter.use_x_forwarded_host = True
# If your proxy does not add the x_forwarded_host header, set
# the following to the *public* host url.
# (Note: This will be overridden by the use_x_forwarded_host option
# if it is set to True and the proxy adds the header correctly.
# base_url_filter.base_url = "http://www.example.com"
# Set to True if you'd like to abort execution if a controller gets an
# unexpected parameter. False by default
# tg.strict_parameters = False
# LOGGING
# Logging configuration generally follows the style of the standard
# Python logging module configuration. Note that when specifying
# log format messages, you need to use *() for formatting variables.
# Deployment independent log configuration is in fotokiste/config/log.cfg
[logging]
[[handlers]]
[[[access_out]]]
# set the filename as the first argument below
args="('server.log',)"
class='FileHandler'
level='INFO'
formatter='message_only'
[[loggers]]
[[[fotokiste]]]
level='ERROR'
qualname='fotokiste'
handlers=['error_out']
[[[access]]]
level='INFO'
qualname='turbogears.access'
handlers=['access_out']
propagate=0

77
fotokiste/setup.py Normal file
View file

@ -0,0 +1,77 @@
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from turbogears.finddata import find_package_data
import os
execfile(os.path.join("fotokiste", "release.py"))
packages=find_packages()
package_data = find_package_data(where='fotokiste',
package='fotokiste')
if os.path.isdir('locales'):
packages.append('locales')
package_data.update(find_package_data(where='locales',
exclude=('*.po',), only_in_packages=False))
setup(
name="fotokiste",
version=version,
# uncomment the following lines if you fill them out in release.py
#description=description,
#author=author,
#author_email=email,
#url=url,
#download_url=download_url,
#license=license,
install_requires=[
"TurboGears >= 1.0.4.4",
"SQLObject>=0.8"
],
zip_safe=False,
packages=packages,
package_data=package_data,
keywords=[
# Use keywords if you'll be adding your package to the
# Python Cheeseshop
# if this has widgets, uncomment the next line
# 'turbogears.widgets',
# if this has a tg-admin command, uncomment the next line
# 'turbogears.command',
# if this has identity providers, uncomment the next line
# 'turbogears.identity.provider',
# If this is a template plugin, uncomment the next line
# 'python.templating.engines',
# If this is a full application, uncomment the next line
# 'turbogears.app',
],
classifiers=[
'Development Status :: 3 - Alpha',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
'Framework :: TurboGears',
# if this is an application that you'll distribute through
# the Cheeseshop, uncomment the next line
# 'Framework :: TurboGears :: Applications',
# if this is a package that includes widgets that you'll distribute
# through the Cheeseshop, uncomment the next line
# 'Framework :: TurboGears :: Widgets',
],
test_suite='nose.collector',
entry_points = {
'console_scripts': [
'start-fotokiste = fotokiste.commands:start',
],
},
# Uncomment next line and create a default.cfg file in your project dir
# if you want to package a default configuration in your egg.
#data_files = [('config', ['default.cfg'])],
)

18
fotokiste/start-fotokiste.py Executable file
View file

@ -0,0 +1,18 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Start script for the fotokiste TurboGears project.
This script is only needed during development for running from the project
directory. When the project is installed, easy_install will create a
proper start script.
"""
import sys
from fotokiste.commands import start, ConfigurationError
if __name__ == "__main__":
try:
start()
except ConfigurationError, exc:
sys.stderr.write(str(exc))
sys.exit(1)

32
fotokiste/test.cfg Normal file
View file

@ -0,0 +1,32 @@
[global]
# You can place test-specific configuration options here (like test db uri, etc)
# DATABASE
sqlobject.dburi = "sqlite:///:memory:"
# LOGGING
[logging]
[[formatters]]
[[[full_content]]]
format='*(asctime)s *(name)s *(levelname)s *(message)s'
[[handlers]]
[[[test_out]]]
class='StreamHandler'
level='DEBUG'
args='(sys.stdout,)'
formatter='full_content'
[[loggers]]
[[[fotokiste]]]
level='DEBUG'
qualname='fotokiste'
handlers=['test_out']
[[[turbogears]]]
level='INFO'
qualname='turbogears'
handlers=['test_out']