summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2010-11-04 01:32:02 -0400
committerChris McDonough <chrism@plope.com>2010-11-04 01:32:02 -0400
commitbf380180c2c5e56131690a56a613c9a229ba7cf8 (patch)
tree3d7cb2d48b1741cb51a6714cd8ca631c99870dba
parent7a3465215705a114abac44ae1002904019b0a467 (diff)
downloadpyramid-bf380180c2c5e56131690a56a613c9a229ba7cf8.tar.gz
pyramid-bf380180c2c5e56131690a56a613c9a229ba7cf8.tar.bz2
pyramid-bf380180c2c5e56131690a56a613c9a229ba7cf8.zip
fix project documentation to account for starter paster template changes
-rw-r--r--docs/narr/MyProject/CHANGES.txt5
-rw-r--r--docs/narr/MyProject/development.ini15
-rw-r--r--docs/narr/MyProject/myproject/__init__.py18
-rw-r--r--docs/narr/MyProject/myproject/models.py2
-rw-r--r--docs/narr/MyProject/myproject/templates/mytemplate.pt158
-rw-r--r--docs/narr/MyProject/myproject/templates/static/favicon.icobin0 -> 1406 bytes
-rw-r--r--docs/narr/MyProject/myproject/templates/static/logo.pngbin0 -> 6641 bytes
-rw-r--r--docs/narr/MyProject/myproject/templates/static/pylons.css70
-rw-r--r--docs/narr/MyProject/myproject/tests.py1
-rw-r--r--docs/narr/MyProject/setup.py14
10 files changed, 177 insertions, 106 deletions
diff --git a/docs/narr/MyProject/CHANGES.txt b/docs/narr/MyProject/CHANGES.txt
index 1544cf53b..35a34f332 100644
--- a/docs/narr/MyProject/CHANGES.txt
+++ b/docs/narr/MyProject/CHANGES.txt
@@ -1,3 +1,4 @@
-0.1
+0.0
+---
- Initial version
+- Initial version
diff --git a/docs/narr/MyProject/development.ini b/docs/narr/MyProject/development.ini
new file mode 100644
index 000000000..6741af913
--- /dev/null
+++ b/docs/narr/MyProject/development.ini
@@ -0,0 +1,15 @@
+[DEFAULT]
+debug = true
+
+[app:main]
+use = egg:MyProject#app
+reload_templates = true
+debug_authorization = false
+debug_notfound = false
+debug_templates = true
+default_locale_name = en
+
+[server:main]
+use = egg:Paste#http
+host = 0.0.0.0
+port = 6543
diff --git a/docs/narr/MyProject/myproject/__init__.py b/docs/narr/MyProject/myproject/__init__.py
index cbdfd3ac6..2dbaf0a88 100644
--- a/docs/narr/MyProject/myproject/__init__.py
+++ b/docs/narr/MyProject/myproject/__init__.py
@@ -1,2 +1,18 @@
-# A package
+from pyramid.configuration import Configurator
+from myproject.models import get_root
+
+def app(global_config, **settings):
+ """ This function returns a WSGI application.
+
+ It is usually called by the PasteDeploy framework during
+ ``paster serve``.
+ """
+ config = Configurator(root_factory=get_root, settings=settings)
+ config.begin()
+ config.add_view('myproject.views.my_view',
+ context='myproject.models.MyModel',
+ renderer='myproject:templates/mytemplate.pt')
+ config.add_static_view('static', 'myproject:templates/static')
+ config.end()
+ return config.make_wsgi_app()
diff --git a/docs/narr/MyProject/myproject/models.py b/docs/narr/MyProject/myproject/models.py
index a37762ff4..75dec7505 100644
--- a/docs/narr/MyProject/myproject/models.py
+++ b/docs/narr/MyProject/myproject/models.py
@@ -3,5 +3,5 @@ class MyModel(object):
root = MyModel()
-def get_root(environ):
+def get_root(request):
return root
diff --git a/docs/narr/MyProject/myproject/templates/mytemplate.pt b/docs/narr/MyProject/myproject/templates/mytemplate.pt
index 9178b5866..a5a0dd214 100644
--- a/docs/narr/MyProject/myproject/templates/mytemplate.pt
+++ b/docs/narr/MyProject/myproject/templates/mytemplate.pt
@@ -1,99 +1,69 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:tal="http://xml.zope.org/namespaces/tal">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" xmlns:tal="http://xml.zope.org/namespaces/tal">
<head>
-<meta http-equiv="content-type" content="text/html; charset=utf-8" />
-<title>${project} Application</title>
-<meta name="keywords" content="python web application" />
-<meta name="description" content="pyramid web application" />
-<link href="${request.application_url}/static/default.css" rel="stylesheet" type="text/css" />
+ <title>The Pyramid Web Application Development Framework</title>
+ <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
+ <meta name="keywords" content="python web application" />
+ <meta name="description" content="pyramid web application" />
+ <link rel="shortcut icon" href="${request.application_url}/static/favicon.ico" />
+ <link rel="stylesheet" href="${request.application_url}/static/pylons.css" type="text/css" media="screen" charset="utf-8" />
+ <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Nobile:regular,italic,bold,bolditalic&amp;subset=latin" type="text/css" media="screen" charset="utf-8" />
</head>
<body>
-<!-- start header -->
-<div id="logo">
- <h2><code>${project}</code>, a <code>Pyramid</code> application</h2>
-</div>
-<div id="header">
- <div id="menu">
- </div>
-</div>
-<!-- end header -->
-<div id="wrapper">
- <!-- start page -->
- <div id="page">
- <!-- start content -->
- <div id="content">
- <div class="post">
- <h1 class="title">Welcome to <code>${project}</code>, an
- application generated by the <a
- href="http://pylonshq.com/pyramid">Pyramid</a> web
- application framework.</h1>
- </div>
- </div>
- <!-- end content -->
- <!-- start sidebar -->
- <div id="sidebar">
- <ul>
- <li id="search">
- <h2>Search<br/> <code>Pyramid</code> Documentation</h2>
- <form method="get"
- action="http://pylonshq.com/docs/pyramid/current/searchresults">
- <fieldset>
- <input type="text" id="q" name="text" value="" />
- <input type="submit" id="x" value="Search" />
- </fieldset>
- </form>
- </li>
- <li>
- <h2><code>Pyramid</code> links</h2>
- <ul>
- <li><a
- href="http://pylonshq.com/docs/pyramid/current/#narrative-documentation">Narrative
- Documentation</a>
- </li>
- <li>
- <a
- href="http://pylonshq.com/docs/pyramid/current/#api-documentation">API
- Documentation</a>
- </li>
- <li>
- <a
- href="http://pylonshq.com/docs/pyramid/current/#tutorials">Tutorials</a>
- </li>
- <li>
- <a
- href="http://pylonshq.com/docs/pyramid/current/#change-history">Change
- History</a>
- </li>
- <li>
- <a
- href="http://pylonshq.com/docs/pyramid/current/#sample-applications">Sample
- Applications</a>
- </li>
- <li>
- <a
- href="http://pylonshq.com/docs/pyramid/current/#support-and-development">Support
- and Development</a>
- </li>
- <li>
- <a
- href="irc://irc.freenode.net#pylons">IRC Channel</a>
- </li>
- </ul>
- </li>
- </ul>
- </div>
- <!-- end sidebar -->
- <div style="clear: both;">&nbsp;</div>
- </div>
-</div>
-<!-- end page -->
-<!-- start footer -->
-<div id="footer">
- <p id="legal">( c ) 2008. All Rights Reserved. Template design
- by <a href="http://www.freecsstemplates.org/">Free CSS
- Templates</a>.</p>
-</div>
-<!-- end footer -->
+ <div id="header">
+ <div class="header">The Pyramid Web Application Development Framework</div>
+ </div>
+ <div id="top">
+ <div class="top align-center">
+ <img src="${request.application_url}/static/logo.png" width="300" height="80"/>
+ <p class="app-welcome">
+ Welcome to <span class="app-name">${project}</span>, an application generated by<br/>
+ the Pyramid web application development framework.
+ </p>
+ </div>
+ </div>
+ <div id="bottom">
+ <div class="bottom">
+ <div id="left" class="align-right">
+ <h3>Search Pyramid documentation</h3>
+ <form method="get" action="http://docs.pylonshq.com/pyramid/dev/search.html">
+ <input type="text" id="q" name="q" value="" />
+ <input type="submit" id="x" value="Search" />
+ </form>
+ </div>
+ <div id="right" class="align-left">
+ <h3>Pyramid links</h3>
+ <ul class="links">
+ <li>
+ <a href="http://pylonshq.com">Pylons Website</a>
+ </li>
+ <li>
+ <a href="http://docs.pylonshq.com/pyramid/dev/#narrative-documentation">Narrative Documentation</a>
+ </li>
+ <li>
+ <a href="http://docs.pylonshq.com/pyramid/dev/#api-documentation">API Documentation</a>
+ </li>
+ <li>
+ <a href="http://docs.pylonshq.com/pyramid/dev/#tutorials">Tutorials</a>
+ </li>
+ <li>
+ <a href="http://docs.pylonshq.com/pyramid/dev/#change-history">Change History</a>
+ </li>
+ <li>
+ <a href="http://docs.pylonshq.com/pyramid/dev/#sample-applications">Sample Applications</a>
+ </li>
+ <li>
+ <a href="http://docs.pylonshq.com/pyramid/dev/#support-and-development">Support and Development</a>
+ </li>
+ <li>
+ <a href="irc://irc.freenode.net#pyramid">IRC Channel</a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <div id="footer">
+ <div class="footer">© Copyright 2008-2010, Agendaless Consulting.</div>
+ </div>
</body>
-</html>
+</html> \ No newline at end of file
diff --git a/docs/narr/MyProject/myproject/templates/static/favicon.ico b/docs/narr/MyProject/myproject/templates/static/favicon.ico
new file mode 100644
index 000000000..71f837c9e
--- /dev/null
+++ b/docs/narr/MyProject/myproject/templates/static/favicon.ico
Binary files differ
diff --git a/docs/narr/MyProject/myproject/templates/static/logo.png b/docs/narr/MyProject/myproject/templates/static/logo.png
new file mode 100644
index 000000000..88f5d9865
--- /dev/null
+++ b/docs/narr/MyProject/myproject/templates/static/logo.png
Binary files differ
diff --git a/docs/narr/MyProject/myproject/templates/static/pylons.css b/docs/narr/MyProject/myproject/templates/static/pylons.css
new file mode 100644
index 000000000..a9c5c55c2
--- /dev/null
+++ b/docs/narr/MyProject/myproject/templates/static/pylons.css
@@ -0,0 +1,70 @@
+html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;/* 16px */
+vertical-align:baseline;background:transparent;}
+body{line-height:1;}
+ol,ul{list-style:none;}
+blockquote,q{quotes:none;}
+blockquote:before,blockquote:after,q:before,q:after{content:'';content:none;}
+/* remember to define focus styles! */
+:focus{outline:0;}
+/* remember to highlight inserts somehow! */
+ins{text-decoration:none;}
+del{text-decoration:line-through;}
+/* tables still need 'cellspacing="0"' in the markup */
+table{border-collapse:collapse;border-spacing:0;}
+/* restyling */
+sub{vertical-align:sub;font-size:smaller;line-height:normal;}
+sup{vertical-align:super;font-size:smaller;line-height:normal;}
+/* lists */
+ul,menu,dir{display:block;list-style-type:disc;margin:1em 0;padding-left:40px;}
+ol{display:block;list-style-type:decimal-leading-zero;margin:1em 0;padding-left:40px;}
+li{display:list-item;}
+/* nested lists have no top/bottom margins */
+ul ul,ul ol,ul dir,ul menu,ul dl,ol ul,ol ol,ol dir,ol menu,ol dl,dir ul,dir ol,dir dir,dir menu,dir dl,menu ul,menu ol,menu dir,menu menu,menu dl,dl ul,dl ol,dl dir,dl menu,dl dl{margin-top:0;margin-bottom:0;}
+/* 2 deep unordered lists use a circle */
+ol ul,ul ul,menu ul,dir ul,ol menu,ul menu,menu menu,dir menu,ol dir,ul dir,menu dir,dir dir{list-style-type:circle;}
+/* 3 deep (or more) unordered lists use a square */
+ol ol ul,ol ul ul,ol menu ul,ol dir ul,ol ol menu,ol ul menu,ol menu menu,ol dir menu,ol ol dir,ol ul dir,ol menu dir,ol dir dir,ul ol ul,ul ul ul,ul menu ul,ul dir ul,ul ol menu,ul ul menu,ul menu menu,ul dir menu,ul ol dir,ul ul dir,ul menu dir,ul dir dir,menu ol ul,menu ul ul,menu menu ul,menu dir ul,menu ol menu,menu ul menu,menu menu menu,menu dir menu,menu ol dir,menu ul dir,menu menu dir,menu dir dir,dir ol ul,dir ul ul,dir menu ul,dir dir ul,dir ol menu,dir ul menu,dir menu menu,dir dir menu,dir ol dir,dir ul dir,dir menu dir,dir dir dir{list-style-type:square;}
+.hidden{display:none;}
+p{line-height:1.5em;}
+h1{font-size:1.75em;/* 28px */
+line-height:1.7em;font-family:helvetica,verdana;}
+h2{font-size:1.5em;/* 24px */
+line-height:1.7em;font-family:helvetica,verdana;}
+h3{font-size:1.25em;/* 20px */
+line-height:1.7em;font-family:helvetica,verdana;}
+h4{font-size:1em;line-height:1.7em;font-family:helvetica,verdana;}
+html,body{width:100%;height:100%;}
+body{margin:0;padding:0;background-color:#ffffff;position:relative;font:16px/24px "Nobile","Lucida Grande",Lucida,Verdana,sans-serif;}
+a{color:#1b61d6;text-decoration:none;}
+a:hover{color:#e88f00;text-decoration:underline;}
+body h1,
+body h2,
+body h3,
+body h4,
+body h5,
+body h6{font-family:"Nobile","Lucida Grande",Lucida,Verdana,sans-serif;font-weight:normal;color:#144fb2;font-style:normal;}
+#header,#footer{width:100%;color:#ffffff;height:40px;position:absolute;text-align:center;line-height:40px;overflow:hidden;font-size:12px;}
+#header{background-color:#e88f00;top:0;font-size:14px;}
+#footer{background-color:#000000;bottom:0;}
+.header,.footer{width:700px;margin-right:auto;margin-left:auto;}
+.wrapper{width:100%}
+#top,#bottom{width:100%;}
+#top{color:#888;background-color:#eee;height:300px;border-bottom:2px solid #ddd;}
+#bottom{color:#222;background-color:#ffffff;}
+.top,.bottom{width:700px;margin-right:auto;margin-left:auto;}
+.top{padding-top:100px;}
+.app-welcome{margin-top:25px;}
+.app-name{color:#000000;font-weight:bold;}
+.bottom{padding-top:50px;}
+#left{width:325px;float:left;padding-right:25px;}
+#right{width:325px;float:right;padding-left:25px;}
+.align-left{text-align:left;}
+.align-right{text-align:right;}
+.align-center{text-align:center;}
+ul.links{margin:0;padding:0;}
+ul.links li{list-style-type:none;font-size:14px;}
+form{border-style:none;}
+fieldset{border-style:none;}
+input{color:#222;border:1px solid #ccc;font-family:sans-serif;font-size:12px;line-height:16px;}
+input[type=text]{}
+input[type=submit]{background-color:#ddd;font-weight:bold;}
diff --git a/docs/narr/MyProject/myproject/tests.py b/docs/narr/MyProject/myproject/tests.py
index e179819d7..2f14a946b 100644
--- a/docs/narr/MyProject/myproject/tests.py
+++ b/docs/narr/MyProject/myproject/tests.py
@@ -17,3 +17,4 @@ class ViewTests(unittest.TestCase):
info = my_view(request)
self.assertEqual(info['project'], 'MyProject')
+
diff --git a/docs/narr/MyProject/setup.py b/docs/narr/MyProject/setup.py
index c827f8295..31f6c9d37 100644
--- a/docs/narr/MyProject/setup.py
+++ b/docs/narr/MyProject/setup.py
@@ -6,6 +6,8 @@ here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.txt')).read()
CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
+requires = ['pyramid']
+
setup(name='MyProject',
version='0.0',
description='MyProject',
@@ -19,20 +21,16 @@ setup(name='MyProject',
author='',
author_email='',
url='',
- keywords='web wsgi pylons pyramid bfg',
+ keywords='web wsgi bfg pyramid pylons',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
- install_requires=[
- 'pyramid',
- ],
- tests_require=[
- 'pyramid',
- ],
+ install_requires=requires,
+ tests_require=requires,
test_suite="myproject",
entry_points = """\
[paste.app_factory]
- app = myproject.run:app
+ app = myproject:app
"""
)