diff --git a/fotokiste/README.txt b/fotokiste/README.txt new file mode 100644 index 0000000..5f82080 --- /dev/null +++ b/fotokiste/README.txt @@ -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. \ No newline at end of file diff --git a/fotokiste/__init__.py b/fotokiste/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/fotokiste/dev.cfg b/fotokiste/dev.cfg new file mode 100644 index 0000000..3ae6213 --- /dev/null +++ b/fotokiste/dev.cfg @@ -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 + + diff --git a/fotokiste/fotokiste.egg-info/PKG-INFO b/fotokiste/fotokiste.egg-info/PKG-INFO new file mode 100644 index 0000000..5403fc6 --- /dev/null +++ b/fotokiste/fotokiste.egg-info/PKG-INFO @@ -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 diff --git a/fotokiste/fotokiste.egg-info/SOURCES.txt b/fotokiste/fotokiste.egg-info/SOURCES.txt new file mode 100644 index 0000000..c2f514c --- /dev/null +++ b/fotokiste/fotokiste.egg-info/SOURCES.txt @@ -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 \ No newline at end of file diff --git a/fotokiste/fotokiste.egg-info/dependency_links.txt b/fotokiste/fotokiste.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/fotokiste/fotokiste.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/fotokiste/fotokiste.egg-info/entry_points.txt b/fotokiste/fotokiste.egg-info/entry_points.txt new file mode 100644 index 0000000..8a8c6f4 --- /dev/null +++ b/fotokiste/fotokiste.egg-info/entry_points.txt @@ -0,0 +1,3 @@ +[console_scripts] +start-fotokiste = fotokiste.commands:start + diff --git a/fotokiste/fotokiste.egg-info/not-zip-safe b/fotokiste/fotokiste.egg-info/not-zip-safe new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/fotokiste/fotokiste.egg-info/not-zip-safe @@ -0,0 +1 @@ + diff --git a/fotokiste/fotokiste.egg-info/paster_plugins.txt b/fotokiste/fotokiste.egg-info/paster_plugins.txt new file mode 100644 index 0000000..14fec70 --- /dev/null +++ b/fotokiste/fotokiste.egg-info/paster_plugins.txt @@ -0,0 +1,2 @@ +TurboGears +PasteScript diff --git a/fotokiste/fotokiste.egg-info/requires.txt b/fotokiste/fotokiste.egg-info/requires.txt new file mode 100644 index 0000000..b9df687 --- /dev/null +++ b/fotokiste/fotokiste.egg-info/requires.txt @@ -0,0 +1,2 @@ +TurboGears >= 1.0.4.4 +SQLObject>=0.8 \ No newline at end of file diff --git a/fotokiste/fotokiste.egg-info/sqlobject.txt b/fotokiste/fotokiste.egg-info/sqlobject.txt new file mode 100644 index 0000000..f033968 --- /dev/null +++ b/fotokiste/fotokiste.egg-info/sqlobject.txt @@ -0,0 +1,2 @@ +db_module=fotokiste.model +history_dir=$base/fotokiste/sqlobject-history diff --git a/fotokiste/fotokiste.egg-info/top_level.txt b/fotokiste/fotokiste.egg-info/top_level.txt new file mode 100644 index 0000000..9b2329a --- /dev/null +++ b/fotokiste/fotokiste.egg-info/top_level.txt @@ -0,0 +1 @@ +fotokiste diff --git a/fotokiste/fotokiste/__init__.py b/fotokiste/fotokiste/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/fotokiste/fotokiste/commands.py b/fotokiste/fotokiste/commands.py new file mode 100644 index 0000000..79a7ced --- /dev/null +++ b/fotokiste/fotokiste/commands.py @@ -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()) diff --git a/fotokiste/fotokiste/config/__init__.py b/fotokiste/fotokiste/config/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/fotokiste/fotokiste/config/app.cfg b/fotokiste/fotokiste/config/app.cfg new file mode 100644 index 0000000..1d4626e --- /dev/null +++ b/fotokiste/fotokiste/config/app.cfg @@ -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="" + +# 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" diff --git a/fotokiste/fotokiste/config/log.cfg b/fotokiste/fotokiste/config/log.cfg new file mode 100644 index 0000000..ce776f8 --- /dev/null +++ b/fotokiste/fotokiste/config/log.cfg @@ -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,)' diff --git a/fotokiste/fotokiste/controllers.py b/fotokiste/fotokiste/controllers.py new file mode 100644 index 0000000..00e0cbe --- /dev/null +++ b/fotokiste/fotokiste/controllers.py @@ -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()) diff --git a/fotokiste/fotokiste/json.py b/fotokiste/fotokiste/json.py new file mode 100644 index 0000000..66d5cfb --- /dev/null +++ b/fotokiste/fotokiste/json.py @@ -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 + diff --git a/fotokiste/fotokiste/model.py b/fotokiste/fotokiste/model.py new file mode 100644 index 0000000..e69f44d --- /dev/null +++ b/fotokiste/fotokiste/model.py @@ -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 + + diff --git a/fotokiste/fotokiste/release.py b/fotokiste/fotokiste/release.py new file mode 100644 index 0000000..66b7ec9 --- /dev/null +++ b/fotokiste/fotokiste/release.py @@ -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" diff --git a/fotokiste/fotokiste/static/css/style.css b/fotokiste/fotokiste/static/css/style.css new file mode 100644 index 0000000..c98d40e --- /dev/null +++ b/fotokiste/fotokiste/static/css/style.css @@ -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; +} \ No newline at end of file diff --git a/fotokiste/fotokiste/static/images/favicon.ico b/fotokiste/fotokiste/static/images/favicon.ico new file mode 100644 index 0000000..332557b Binary files /dev/null and b/fotokiste/fotokiste/static/images/favicon.ico differ diff --git a/fotokiste/fotokiste/static/images/header_inner.png b/fotokiste/fotokiste/static/images/header_inner.png new file mode 100644 index 0000000..2b2d87d Binary files /dev/null and b/fotokiste/fotokiste/static/images/header_inner.png differ diff --git a/fotokiste/fotokiste/static/images/info.png b/fotokiste/fotokiste/static/images/info.png new file mode 100644 index 0000000..329c523 Binary files /dev/null and b/fotokiste/fotokiste/static/images/info.png differ diff --git a/fotokiste/fotokiste/static/images/ok.png b/fotokiste/fotokiste/static/images/ok.png new file mode 100644 index 0000000..fee6751 Binary files /dev/null and b/fotokiste/fotokiste/static/images/ok.png differ diff --git a/fotokiste/fotokiste/static/images/tg_under_the_hood.png b/fotokiste/fotokiste/static/images/tg_under_the_hood.png new file mode 100644 index 0000000..bc9c79c Binary files /dev/null and b/fotokiste/fotokiste/static/images/tg_under_the_hood.png differ diff --git a/fotokiste/fotokiste/static/images/under_the_hood_blue.png b/fotokiste/fotokiste/static/images/under_the_hood_blue.png new file mode 100644 index 0000000..90e84b7 Binary files /dev/null and b/fotokiste/fotokiste/static/images/under_the_hood_blue.png differ diff --git a/fotokiste/fotokiste/templates/__init__.py b/fotokiste/fotokiste/templates/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/fotokiste/fotokiste/templates/login.kid b/fotokiste/fotokiste/templates/login.kid new file mode 100644 index 0000000..4fd6755 --- /dev/null +++ b/fotokiste/fotokiste/templates/login.kid @@ -0,0 +1,114 @@ + + + + + + Login + + + + +
+

Login

+

${message}

+
+ + + + + + + + + + + + +
+ + + +
+ + + +
+ +
+ + + +
+ +
+
+
+ + diff --git a/fotokiste/fotokiste/templates/master.kid b/fotokiste/fotokiste/templates/master.kid new file mode 100644 index 0000000..86fb7da --- /dev/null +++ b/fotokiste/fotokiste/templates/master.kid @@ -0,0 +1,50 @@ + + + + + + + Your title goes here + + + + + + +
+ + Login + + + Welcome ${tg.identity.user.display_name or tg.identity.user.user_name}. + Logout + +
+ + + +
+
+
page content
+
+ + + + + diff --git a/fotokiste/fotokiste/templates/welcome.kid b/fotokiste/fotokiste/templates/welcome.kid new file mode 100644 index 0000000..9095267 --- /dev/null +++ b/fotokiste/fotokiste/templates/welcome.kid @@ -0,0 +1,47 @@ + + + + +Welcome to TurboGears + + + + +
+
    +
  1. +

    Model

    +

    Design models in the model.py.
    + Edit dev.cfg to use a different backend, or start with a pre-configured SQLite database.
    + Use script tg-admin sql create to create the database tables.

    +
  2. +
  3. +

    View

    +

    Edit html-like templates in the /templates folder;
    + Put all static contents in the /static folder.

    +
  4. +
  5. +

    Controller

    +

    Edit controllers.py and build your + website structure with the simplicity of Python objects.
    + TurboGears will automatically reload itself when you modify your project.

    +
  6. +
+
If you create something cool, please let people know, and consider contributing something back to the community.
+
+ + + diff --git a/fotokiste/fotokiste/tests/__init__.py b/fotokiste/fotokiste/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/fotokiste/fotokiste/tests/test_controllers.py b/fotokiste/fotokiste/tests/test_controllers.py new file mode 100644 index 0000000..2889fb5 --- /dev/null +++ b/fotokiste/fotokiste/tests/test_controllers.py @@ -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 "welcome to turbogears" in response + diff --git a/fotokiste/fotokiste/tests/test_model.py b/fotokiste/fotokiste/tests/test_model.py new file mode 100644 index 0000000..553cc69 --- /dev/null +++ b/fotokiste/fotokiste/tests/test_model.py @@ -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" + diff --git a/fotokiste/sample-prod.cfg b/fotokiste/sample-prod.cfg new file mode 100644 index 0000000..49e1937 --- /dev/null +++ b/fotokiste/sample-prod.cfg @@ -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 diff --git a/fotokiste/setup.py b/fotokiste/setup.py new file mode 100644 index 0000000..71bd154 --- /dev/null +++ b/fotokiste/setup.py @@ -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'])], + ) diff --git a/fotokiste/start-fotokiste.py b/fotokiste/start-fotokiste.py new file mode 100755 index 0000000..7bf5069 --- /dev/null +++ b/fotokiste/start-fotokiste.py @@ -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) diff --git a/fotokiste/test.cfg b/fotokiste/test.cfg new file mode 100644 index 0000000..4c36b93 --- /dev/null +++ b/fotokiste/test.cfg @@ -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']