Changeset 1585
- Timestamp:
- 05/23/08 16:33:49 (22 months ago)
- Location:
- trunk/pylucid
- Files:
-
- 3 added
- 19 modified
-
doc/plugin_api.py (modified) (2 diffs, 2 props)
-
PyLucid/db_dump_datadir/PyLucid_page.py (modified) (1 diff)
-
PyLucid/db_dump_datadir/PyLucid_template.py (modified) (1 diff)
-
PyLucid/index.py (modified) (2 diffs)
-
PyLucid/install/BaseInstall.py (modified) (5 diffs)
-
PyLucid/install/install.py (modified) (1 diff)
-
PyLucid/install/update.py (modified) (3 diffs)
-
PyLucid/middlewares/pagemessages.py (added)
-
PyLucid/middlewares/pagestats.py (modified) (4 diffs)
-
PyLucid/middlewares/utils.py (added)
-
PyLucid/models/Plugin.py (modified) (2 diffs)
-
PyLucid/plugins_internal/filemanager/filemanager.py (modified) (1 diff)
-
PyLucid/settings_example.py (modified) (1 diff)
-
PyLucid/system/BasePlugin.py (modified) (1 diff)
-
PyLucid/system/internal_page.py (modified) (1 diff)
-
PyLucid/system/markups/tinyTextile.py (modified) (3 diffs)
-
PyLucid/system/page_msg.py (modified) (6 diffs)
-
PyLucid/system/plugin_manager.py (modified) (5 diffs)
-
PyLucid/system/URLs.py (modified) (2 diffs)
-
PyLucid/tools/content_processors.py (modified) (1 diff)
-
tests/test_page_msg.py (added)
-
tests/utils/FakeRequest.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pylucid/doc/plugin_api.py
- Property svn:eol-style set to LF
- Property svn:keywords set to Author
r1507 r1585 11 11 $LastChangedDate$ 12 12 $Rev$ 13 $Author : JensDiemer$13 $Author$ 14 14 15 15 :copyleft: 2008 by Jens Diemer … … 149 149 150 150 #__________________________________________________________________________ 151 # PREFERENCES 152 # 153 def get_my_preferences(self): 154 """ 155 more info about plugin preferences: 156 http://www.pylucid.org/_goto/153/preferences/ 157 """ 158 # Get the preferences from the database: 159 preferences = self.get_preferences() 160 161 # Get a entry (It's a dict api) 162 my_entry_value = preferences["entry_key"] 163 164 165 #__________________________________________________________________________ 151 166 # ENVIRONMENT 152 167 # -
trunk/pylucid/PyLucid/db_dump_datadir/PyLucid_page.py
r1562 r1585 4 4 default = {} 5 5 records = [ 6 [1, u' <h2>Welcome to your PyLucid CMS =;-)</h2> \r\n<p>\r\nNote:\r\n</p>\r\n<ul>\r\n\t<li>After install deactivate the _install section!</li> \r\n</ul>\r\n<h3>list of last page updates</h3>\r\n<p>\r\n<a href="{% lucidTag RSSfeedGenerator count="10" %}" type="application/rss+xml" title="page updates">RSS feed</a><br />\r\n{% lucidTag page_update_list %}\r\n</p>\r\n', None, 0, u'index', u'index', u'index', 1, 1, 1, u'', u'', '2007-06-22 09:48:29', '2007-12-04 02:25:55', 1, 1, True, True, None, None]6 [1, u'Note:\r\n\r\n* After install deactivate the _install section!\r\n\r\n=== list of last page updates\r\n\r\n{% lucidTag page_update_list count=10 %}', None, 0, u'Welcome', u'Welcome', u'Welcome to your PyLucid CMS =;-)', 1, 1, 6, u'', u'', '2007-06-22 09:48:29', '2008-05-23 11:24:42', 1, 1, True, True, None, None] 7 7 [2, u'h2. sub menu\r\n\r\n{% lucidTag sub_menu %}', None, 0, u'example pages', u'ExamplePages', u'example pages', 1, 1, 2, u'', u'', '2007-06-22 09:48:29', '2007-06-22 09:48:33', 1, 1, True, True, None, None] 8 8 [3, u'h1. tinyTextile help\r\n\r\nh1. headlines\r\n\r\nheadlines are introduced with \'h1.\':\r\n\r\n<pre>\r\nh1. h-1 headline\r\n\r\nh2. h-2 headline\r\n</pre>\r\n\r\nResult:\r\n\r\nh1. h-1 headline\r\n\r\nh2. h-2 headline\r\n\r\n(Important: one blank line under the headline!)\r\n\r\n<hr class="big_hr">\r\n\r\nh1. Text formatting\r\n\r\n<pre>\r\nI am a --small-- word with <small> tag.\r\nThis is a *fat* word with <strong> tag.\r\n</pre>\r\n\r\nResult:\r\n\r\nI am a --small-- word with ==<small>== tag.\r\nThis is a *fat* word with ==<strong>== tag.\r\n\r\n<hr class="big_hr">\r\n\r\nh1. Links\r\n\r\nLinks according in the following pattern:\r\n\r\n<pre>"LinkText":URL</pre>\r\n\r\nexamples:\r\n<pre>\r\nhttp://exampledomain.dtl\r\nftp://exampledomain.dtl\r\nmailto:name@exampledomain.dtl\r\nhttp://www.python-forum.de\r\nor better: "Das deutsche Python-Forum":http://www.python-forum.de\r\nThis is a link, too: "Link":?#unten\r\nWiki like, internal PyLucid links: [[ExamplePageName]]\r\n</pre>\r\n\r\nResult:\r\nhttp://exampledomain.dtl\r\nftp://exampledomain.dtl\r\nmailto:name@exampledomain.dtl\r\nhttp://www.python-forum.de\r\nor better: "Das deutsche Python-Forum":http://www.python-forum.de\r\nThis is a link, too: "Link":?#unten\r\nWiki like, internal PyLucid links: [[ExamplePageName]]\r\n\r\n<hr class="big_hr">\r\n\r\nh1. List\r\n\r\nYou can make ==<ul>== liste with "*" and ==<ol>== list with "#".\r\nNote: You can\'t mixed this list types ;)\r\n\r\nexamples:\r\n\r\n<pre>\r\nnormal list:\r\n* Lorem ipsum dolor sit amet\r\n** consectetuer adipiscing elit\r\n**** sed diam nonummy nibh\r\n**** euismod tincidunt ut laoreet\r\n** dolore magna aliquam erat volutpat.\r\n\r\nnumbered list:\r\n# Lorem ipsum dolor sit amet\r\n## consectetuer adipiscing elit\r\n#### sed diam nonummy nibh\r\n#### euismod tincidunt ut laoreet\r\n## dolore magna aliquam erat volutpat.\r\n</pre>\r\n\r\nResult:\r\n\r\nnormal list:\r\n* Lorem ipsum dolor sit amet\r\n** consectetuer adipiscing elit\r\n**** sed diam nonummy nibh\r\n**** euismod tincidunt ut laoreet\r\n** dolore magna aliquam erat volutpat.\r\n\r\nnumbered list:\r\n# Lorem ipsum dolor sit amet\r\n## consectetuer adipiscing elit\r\n#### sed diam nonummy nibh\r\n#### euismod tincidunt ut laoreet\r\n## dolore magna aliquam erat volutpat.\r\n\r\n<hr class="big_hr">\r\n\r\nh1. Bilder\r\n\r\nEin HTML-img-Tag wird erzeugt, wenn eine Adresse mit einem "!"-Zeichen\r\numschlossen ist.\r\n\r\n<pre>\r\n!http://images.sourceforge.net/images/project-support.jpg!\r\n!/favicon.ico!\r\n!http://domain.tld/pics/ich werde zu keiner URL weil hier leerzeichen sind.jpg!\r\n</pre>\r\n\r\nResult:\r\n\r\n!http://images.sourceforge.net/images/project-support.jpg!\r\n!/favicon.ico!\r\n!http://domain.tld/pics/ich werde zu keiner URL weil hier leerzeichen sind.jpg!\r\n\r\n<hr class="big_hr">\r\n\r\nh1. Embed Python SourceCode\r\n\r\nPut sourcecode between ==<python>== tag. Note: The start and end tag must be located alone in a line!\r\n\r\nexample:\r\n\r\n==\r\n<python>\r\n#!/usr/bin/python\r\n# -*- coding: UTF-8 -*-\r\n\r\n"""Ein kleines Skript"""\r\n\r\nprint "Hello Word: I love Python!"\r\n</python>\r\n==\r\n\r\nResult:\r\n<python>\r\n#!/usr/bin/python\r\n# -*- coding: UTF-8 -*-\r\n\r\n"""Ein kleines Skript"""\r\n\r\nprint "Hello Word: I love Python!"\r\n</python>\r\n\r\n\r\n<hr class="big_hr">\r\n\r\nh1. Embed source code generally\r\n\r\nWith the ==<code=ext>== Tag you can highlight everything, which offers Pygments.\r\n\'ext\' is the file extension.\r\n\r\nexamples:\r\n\r\n==\r\n<code=php>\r\n<?php\r\n$conn_id = ftp_connect($ftp_server);\r\n?>\r\n</code>\r\n<code=css>\r\nbody {\r\n color: black;\r\n}\r\n</code>\r\n==\r\n\r\nResult:\r\n\r\n<code=php>\r\n<?php\r\n$conn_id = ftp_connect($ftp_server);\r\n?>\r\n</code>\r\n<code=css>\r\nbody {\r\n color: black;\r\n}\r\n</code>\r\n\r\n<hr class="big_hr">\r\n\r\nh1. Escaping\r\n\r\nText inner two "="-chars would be escaped.\r\n\r\nexample:\r\n--------\r\n========\r\nTable: <table width="90%" border="0" align="center">\r\nLink: <a href="URL">txt</a>\r\nInput: <input type="submit" value="preview" />\r\n========\r\n\r\nIt goes also within a flow text:\r\nHere ist no Link: ========<a href="URL">txt</a>======== nice?\r\n\r\n<hr class="big_hr">\r\n\r\nh1. pre-Formarted-Text\r\n\r\nYou can use the ==<pre>== tag. tinyTextile ingnore the Markup in the area.\r\n\r\n<pre>\r\nExample:\r\n---------\r\nh2. Not a textile headline\r\n<h3>Manuelly h3 headline with html tags</h3>\r\n* This is not a...\r\n* ...textile list\r\n</pre>\r\n\r\n<hr class="big_hr">\r\n\r\nh1. HTML-Code\r\n\r\nYou can insert any HTML code directy in you page. tinyTextile ingnore it.', 2, 0, u'tinyTextile example', u'TinyTextileExample', u'complete tinyTextile Formating examples', 1, 1, 2, u'', u'', '2007-06-22 09:48:29', '2007-06-22 09:51:45', 1, 1, True, True, None, None] -
trunk/pylucid/PyLucid/db_dump_datadir/PyLucid_template.py
r1333 r1585 4 4 default = {} 5 5 records = [ 6 [1, u'basic', '200 7-06-22 09:48:29', '2007-12-07 08:50:16', None, None, u'default template', u'<?xml version="1.0" encoding="UTF-8"?>\r\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "xhtml1-strict.dtd">\r\n<html xmlns="http://www.w3.org/1999/xhtml">\r\n<head>\r\n<title>PyLucid CMS - {% if PAGE.title %}{{ PAGE.title|escape }}{% else %}{{ PAGE.name|escape }}{% endif %}</title>\r\n<meta name="robots" content="{{ robots }}" />\r\n<meta name="keywords" content="{{ PAGE.keywords }}" />\r\n<meta name="description" content="{{ PAGE.description }}" />\r\n<meta name="Author" content="PyLucidCMS" />\r\n<meta name="DC.Date" content="{{ PAGE.lastupdatetime }}" />\r\n<meta name="DC.Date.created" content="{{ PAGE.datetime }}" />\r\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r\n<meta name="MSSmartTagsPreventParsing" content="TRUE" />\r\n<meta http-equiv="imagetoolbar" content="no" />\r\n<link rel="alternate" type="application/rss+xml" title="pages updates" href="{% lucidTag RSSfeedGenerator count="10" %}" />\r\n{% lucidTag page_style %}\r\n</head>\r\n<body>\r\n<div id="headline">\r\n <a href="/">PyLucid CMS</a>\r\n</div>\r\n\r\n<div id="the_menu">\r\n {% lucidTag main_menu %}\r\n <div id="searching">\r\n {% lucidTag search %}\r\n </div>\r\n <a href="http://sourceforge.net/projects/pylucid/" id="logo" alt="goto our SourceForge project page >>" title="goto our SourceForge project page >>">\r\n <img src="http://sourceforge.net/sflogo.php?group_id=146328&type=1" width="88" height="31" border="0" alt="SourceForge Logo" />\r\n </a>\r\n</div>\r\n\r\n<div id="main_content">\r\n <h2 id="page_title">{% if PAGE.title %}{{ PAGE.title|escape }}{% else %}{{ PAGE.name|escape }}{% endif %}</h2>\r\n {% if messages %}\r\n <fieldset id="page_msg"><legend>page message</legend>\r\n {% for message in messages %}\r\n {{ message }}<br />\r\n {% endfor %}\r\n </fieldset>\r\n {% endif %}\r\n {% lucidTag admin_menu %}\r\n <p>{% lucidTag back_links %}</p>\r\n {{ PAGE.content }}\r\n <p id="permalink"><a href="{{ PAGE.get_permalink }}" title="permalink to this page">permalink</a></p>\r\n</div>\r\n\r\n<p id="footer">\r\n powered by {{ powered_by }} | {{ login_link }} | <!-- script_duration --> | last modified: {{ PAGE.lastupdatetime }}\r\n</p>\r\n\r\n</div>\r\n</body>\r\n</html>']7 [2, u'old_basic', '200 7-06-22 09:48:29', '2007-12-07 08:50:38', None, None, u'the old default ghastly design... ;)', u'<?xml version="1.0" encoding="UTF-8"?>\r\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "xhtml1-strict.dtd">\r\n<html xmlns="http://www.w3.org/1999/xhtml">\r\n<head>\r\n<title>PyLucid CMS - {% if PAGE.title %}{{ PAGE.title|escape }}{% else %}{{ PAGE.name|escape }}{% endif %}</title>\r\n<meta name="robots" content="{{ robots }}" />\r\n<meta name="keywords" content="{{ PAGE.keywords }}" />\r\n<meta name="description" content="{{ PAGE.description }}" />\r\n<meta name="Author" content="PyLucidCMS" />\r\n<meta name="DC.Date" content="{{ PAGE.lastupdatetime }}" />\r\n<meta name="DC.Date.created" content="{{ PAGE.datetime }}" />\r\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r\n<meta name="MSSmartTagsPreventParsing" content="TRUE" />\r\n<meta http-equiv="imagetoolbar" content="no" />\r\n<link rel="alternate" type="application/rss+xml" title="pages updates" href="{% lucidTag RSSfeedGenerator count="10" %}" />\r\n{% lucidTag page_style %}\r\n</head>\r\n<body>\r\n<div id="headline"><h2>PyLucid CMS</h2></div>\r\n<div id="sidebar">\r\n{% lucidTag main_menu %}\r\n</div>\r\n\r\n<div id="main-content">\r\n <h2 id="page_title">{% if PAGE.title %}{{ PAGE.title|escape }}{% else %}{{ PAGE.name|escape }}{% endif %}</h2>\r\n {% if messages %}\r\n <fieldset id="page_msg"><legend>page message</legend>\r\n {% for message in messages %}\r\n {{ message }}<br />\r\n {% endfor %}\r\n </fieldset>\r\n {% endif %}\r\n {% lucidTag admin_menu %}\r\n <p>{% lucidTag back_links %}</p>\r\n {{ PAGE.content }}\r\n <p id="permalink"><a href="{{ PAGE.get_permalink }}" title="permalink to this page">permalink</a></p>\r\n <p id="nav_footer">\r\n powered by {{ powered_by }} | {{ login_link }} | <!-- script_duration --> | last modified: {{ PAGE.lastupdatetime }}\r\n </p>\r\n</div>\r\n</body>\r\n</html>']8 [3, u'small_dark', '200 7-06-22 09:48:29', '2007-12-07 08:50:50', None, None, u"The 'small dark' design.", u'<?xml version="1.0" encoding="UTF-8"?>\r\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "xhtml1-strict.dtd">\r\n<html xmlns="http://www.w3.org/1999/xhtml">\r\n<head>\r\n<title>PyLucid CMS - {% if PAGE.title %}{{ PAGE.title|escape }}{% else %}{{ PAGE.name|escape }}{% endif %}</title>\r\n<meta name="robots" content="{{ robots }}" />\r\n<meta name="keywords" content="{{ PAGE.keywords }}" />\r\n<meta name="description" content="{{ PAGE.description }}" />\r\n<meta name="Author" content="PyLucidCMS" />\r\n<meta name="DC.Date" content="{{ PAGE.lastupdatetime }}" />\r\n<meta name="DC.Date.created" content="{{ PAGE.datetime }}" />\r\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r\n<meta name="MSSmartTagsPreventParsing" content="TRUE" />\r\n<meta http-equiv="imagetoolbar" content="no" />\r\n<link rel="alternate" type="application/rss+xml" title="pages updates" href="{% lucidTag RSSfeedGenerator count="10" %}" />\r\n{% lucidTag page_style %}\r\n</head>\r\n<body>\r\n<div id="content">\r\n <p id="head">PyLucid CMS</p>\r\n <hr class="big" />\r\n {% lucidTag main_menu %}\r\n <hr class="small" />\r\n\r\n <h2 id="page_title">{% if PAGE.title %}{{ PAGE.title|escape }}{% else %}{{ PAGE.name|escape }}{% endif %}</h2>\r\n {% if messages %}\r\n <fieldset id="page_msg"><legend>page message</legend>\r\n {% for message in messages %}\r\n {{ message }}<br />\r\n {% endfor %}\r\n </fieldset>\r\n {% endif %}\r\n {% lucidTag admin_menu %}\r\n <p>{% lucidTag back_links %}</p>\r\n {{ PAGE.content }}\r\n \r\n <p id="permalink"><a href="{{ PAGE.get_permalink }}" title="permalink to this page">permalink</a></p>\r\n\r\n <hr class="small" />\r\n <hr class="big" />\r\n <p id="nav_footer">\r\n powered by {{ powered_by }} | {{ login_link }} | <!-- script_duration --> | last modified: {{ PAGE.lastupdatetime }}\r\n </p>\r\n</div>\r\n</body>\r\n</html>']9 [4, u'elementary', '200 7-06-22 09:48:29', '2007-12-07 08:50:57', None, None, u"The 'elementary' design. Ideal as a basis for your own design.", u'<?xml version="1.0" encoding="UTF-8"?>\r\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "xhtml1-strict.dtd">\r\n<html xmlns="http://www.w3.org/1999/xhtml">\r\n<head>\r\n<title>PyLucid CMS - {% if PAGE.title %}{{ PAGE.title|escape }}{% else %}{{ PAGE.name|escape }}{% endif %}</title>\r\n<meta name="robots" content="{{ robots }}" />\r\n<meta name="keywords" content="{{ PAGE.keywords }}" />\r\n<meta name="description" content="{{ PAGE.description }}" />\r\n<meta name="Author" content="PyLucidCMS" />\r\n<meta name="DC.Date" content="{{ PAGE.lastupdatetime }}" />\r\n<meta name="DC.Date.created" content="{{ PAGE.datetime }}" />\r\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r\n<meta name="MSSmartTagsPreventParsing" content="TRUE" />\r\n<meta http-equiv="imagetoolbar" content="no" />\r\n<link rel="alternate" type="application/rss+xml" title="pages updates" href="{% lucidTag RSSfeedGenerator count="10" %}" />\r\n{% lucidTag page_style %}\r\n</head>\r\n<body>\r\n<div id="headline"><h2>PyLucid CMS</h2></div>\r\n\r\n{% lucidTag main_menu %}\r\n\r\n<div id="main_content">\r\n <h2 id="page_title">{% if PAGE.title %}{{ PAGE.title|escape }}{% else %}{{ PAGE.name|escape }}{% endif %}</h2>\r\n {% if messages %}\r\n <fieldset id="page_msg"><legend>page message</legend>\r\n {% for message in messages %}\r\n {{ message }}<br />\r\n {% endfor %}\r\n </fieldset>\r\n {% endif %}\r\n {% lucidTag admin_menu %}\r\n <p>{% lucidTag back_links %}</p>\r\n {{ PAGE.content }}\r\n <p id="permalink"><a href="{{ PAGE.get_permalink }}" title="permalink to this page">permalink</a></p>\r\n</div>\r\n\r\n<p id="footer">\r\n powered by {{ powered_by }} | {{ login_link }} | <!-- script_duration --> | last modified: {{ PAGE.lastupdatetime }}\r\n</p>\r\n\r\n</div>\r\n</body>\r\n</html>']10 [5, u'small_white', '200 7-06-22 09:48:29', '2007-12-07 08:51:05', None, None, u"The 'small white' design.", u'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r\n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">\r\n<head>\r\n<title>PyLucid CMS - {% if PAGE.title %}{{ PAGE.title|escape }}{% else %}{{ PAGE.name|escape }}{% endif %}</title>\r\n<link rel="alternate" type="application/rss+xml" title="pages updates" href="{% lucidTag RSSfeedGenerator count="10" %}" />\r\n<link rel="shortcut icon" type="image/x-icon" href="/favicon_pylucid.ico">\r\n<meta http-equiv="content-type" content="text/html; charset=utf-8" />\r\n<meta name="robots" content="{{ robots }}" />\r\n<meta name="keywords" content="{{ PAGE.keywords }}" />\r\n<meta name="description" content="{{ PAGE.description }}" />\r\n<meta name="DC.Date" content="{{ PAGE.lastupdatetime }}" />\r\n<meta name="DC.Date.created" content="{{ PAGE.datetime }}" />\r\n<meta name="MSSmartTagsPreventParsing" content="TRUE" />\r\n<meta http-equiv="imagetoolbar" content="no" />\r\n{% lucidTag page_style %}\r\n</head>\r\n<body>\r\n<div id="wrap">\r\n <div id="header">\r\n <a href="/">\r\n <img id="pylucid_logo" src="/_static/pylucid_logo_2_364x76.jpg" alt="PyLucid CMS" title="PyLucid CMS" />\r\n </a>\r\n </div>\r\n\r\n <div id="leftside">\r\n <h2 class="hide">Menu:</h2>\r\n {% lucidTag main_menu %}\r\n {% lucidTag search %}\r\n </div>\r\n\r\n <div id="contentwide">\r\n <div id="admin">{% lucidTag admin_menu %}</div>\r\n {% if messages %}\r\n <fieldset id="page_msg"><legend>page message</legend>\r\n {% for message in messages %}\r\n {{ message }}<br />\r\n {% endfor %}\r\n </fieldset>\r\n {% endif %}\r\n <h2>{% if PAGE.title %}{{ PAGE.title|escape }}{% else %}{{ PAGE.name|escape }}{% endif %}</h2>\r\n <p>{% lucidTag back_links %}</p>\r\n {{ PAGE.content }}\r\n <p id="permalink"><a href="{{ PAGE.get_permalink }}" title="permalink to this page">permalink</a></p>\r\n </div>\r\n\r\n <div id="footer">\r\n <p>\r\n powered by {{ powered_by }} | {{ login_link }} | <!-- script_duration --> | last modified: {{ PAGE.lastupdatetime }}\r\n </p>\r\n </div>\r\n</div>\r\n</body>\r\n</html>\r\n']6 [1, u'basic', '2008-05-23 11:11:06', '2008-05-23 11:11:06', None, None, u'default template', u'<?xml version="1.0" encoding="UTF-8"?>\r\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "xhtml1-strict.dtd">\r\n<html xmlns="http://www.w3.org/1999/xhtml">\r\n<head>\r\n<title>PyLucid CMS - {% if PAGE.title %}{{ PAGE.title|escape }}{% else %}{{ PAGE.name|escape }}{% endif %}</title>\r\n<meta name="robots" content="{{ robots }}" />\r\n<meta name="keywords" content="{{ PAGE.keywords }}" />\r\n<meta name="description" content="{{ PAGE.description }}" />\r\n<meta name="Author" content="PyLucidCMS" />\r\n<meta name="DC.Date" content="{{ PAGE.lastupdatetime }}" />\r\n<meta name="DC.Date.created" content="{{ PAGE.datetime }}" />\r\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r\n<meta name="MSSmartTagsPreventParsing" content="TRUE" />\r\n<meta http-equiv="imagetoolbar" content="no" />\r\n<link rel="alternate" type="application/rss+xml" title="pages updates" href="{% lucidTag RSSfeedGenerator count="10" %}" />\r\n{% lucidTag page_style %}\r\n</head>\r\n<body>\r\n<div id="headline">\r\n <a href="/">PyLucid CMS</a>\r\n</div>\r\n\r\n<div id="the_menu">\r\n {% lucidTag main_menu %}\r\n <div id="searching">\r\n {% lucidTag search %}\r\n </div>\r\n <a href="http://sourceforge.net/projects/pylucid/" id="logo" alt="goto our SourceForge project page >>" title="goto our SourceForge project page >>">\r\n <img src="http://sourceforge.net/sflogo.php?group_id=146328&type=1" width="88" height="31" border="0" alt="SourceForge Logo" />\r\n </a>\r\n</div>\r\n\r\n<div id="main_content">\r\n <h2 id="page_title">{% if PAGE.title %}{{ PAGE.title|escape }}{% else %}{{ PAGE.name|escape }}{% endif %}</h2>\r\n <!-- page_messages -->\r\n {% lucidTag admin_menu %}\r\n <p>{% lucidTag back_links %}</p>\r\n {{ PAGE.content }}\r\n <p id="permalink"><a href="{{ PAGE.get_permalink }}" title="permalink to this page">permalink</a></p>\r\n</div>\r\n\r\n<p id="footer">\r\n powered by {{ powered_by }} | {{ login_link }} | <!-- script_duration --> | last modified: {{ PAGE.lastupdatetime }}\r\n</p>\r\n\r\n</div>\r\n</body>\r\n</html>'] 7 [2, u'old_basic', '2008-05-23 11:11:06', '2008-05-23 11:11:06', None, None, u'the old default ghastly design... ;)', u'<?xml version="1.0" encoding="UTF-8"?>\r\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "xhtml1-strict.dtd">\r\n<html xmlns="http://www.w3.org/1999/xhtml">\r\n<head>\r\n<title>PyLucid CMS - {% if PAGE.title %}{{ PAGE.title|escape }}{% else %}{{ PAGE.name|escape }}{% endif %}</title>\r\n<meta name="robots" content="{{ robots }}" />\r\n<meta name="keywords" content="{{ PAGE.keywords }}" />\r\n<meta name="description" content="{{ PAGE.description }}" />\r\n<meta name="Author" content="PyLucidCMS" />\r\n<meta name="DC.Date" content="{{ PAGE.lastupdatetime }}" />\r\n<meta name="DC.Date.created" content="{{ PAGE.datetime }}" />\r\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r\n<meta name="MSSmartTagsPreventParsing" content="TRUE" />\r\n<meta http-equiv="imagetoolbar" content="no" />\r\n<link rel="alternate" type="application/rss+xml" title="pages updates" href="{% lucidTag RSSfeedGenerator count="10" %}" />\r\n{% lucidTag page_style %}\r\n</head>\r\n<body>\r\n<div id="headline"><h2>PyLucid CMS</h2></div>\r\n<div id="sidebar">\r\n{% lucidTag main_menu %}\r\n</div>\r\n\r\n<div id="main-content">\r\n <h2 id="page_title">{% if PAGE.title %}{{ PAGE.title|escape }}{% else %}{{ PAGE.name|escape }}{% endif %}</h2>\r\n <!-- page_messages -->\r\n {% lucidTag admin_menu %}\r\n <p>{% lucidTag back_links %}</p>\r\n {{ PAGE.content }}\r\n <p id="permalink"><a href="{{ PAGE.get_permalink }}" title="permalink to this page">permalink</a></p>\r\n <p id="nav_footer">\r\n powered by {{ powered_by }} | {{ login_link }} | <!-- script_duration --> | last modified: {{ PAGE.lastupdatetime }}\r\n </p>\r\n</div>\r\n</body>\r\n</html>'] 8 [3, u'small_dark', '2008-05-23 11:11:06', '2008-05-23 11:11:06', None, None, u"The 'small dark' design.", u'<?xml version="1.0" encoding="UTF-8"?>\r\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "xhtml1-strict.dtd">\r\n<html xmlns="http://www.w3.org/1999/xhtml">\r\n<head>\r\n<title>PyLucid CMS - {% if PAGE.title %}{{ PAGE.title|escape }}{% else %}{{ PAGE.name|escape }}{% endif %}</title>\r\n<meta name="robots" content="{{ robots }}" />\r\n<meta name="keywords" content="{{ PAGE.keywords }}" />\r\n<meta name="description" content="{{ PAGE.description }}" />\r\n<meta name="Author" content="PyLucidCMS" />\r\n<meta name="DC.Date" content="{{ PAGE.lastupdatetime }}" />\r\n<meta name="DC.Date.created" content="{{ PAGE.datetime }}" />\r\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r\n<meta name="MSSmartTagsPreventParsing" content="TRUE" />\r\n<meta http-equiv="imagetoolbar" content="no" />\r\n<link rel="alternate" type="application/rss+xml" title="pages updates" href="{% lucidTag RSSfeedGenerator count="10" %}" />\r\n{% lucidTag page_style %}\r\n</head>\r\n<body>\r\n<div id="content">\r\n <p id="head">PyLucid CMS</p>\r\n <hr class="big" />\r\n {% lucidTag main_menu %}\r\n <hr class="small" />\r\n\r\n <h2 id="page_title">{% if PAGE.title %}{{ PAGE.title|escape }}{% else %}{{ PAGE.name|escape }}{% endif %}</h2>\r\n <!-- page_messages -->\r\n {% lucidTag admin_menu %}\r\n <p>{% lucidTag back_links %}</p>\r\n {{ PAGE.content }}\r\n \r\n <p id="permalink"><a href="{{ PAGE.get_permalink }}" title="permalink to this page">permalink</a></p>\r\n\r\n <hr class="small" />\r\n <hr class="big" />\r\n <p id="nav_footer">\r\n powered by {{ powered_by }} | {{ login_link }} | <!-- script_duration --> | last modified: {{ PAGE.lastupdatetime }}\r\n </p>\r\n</div>\r\n</body>\r\n</html>'] 9 [4, u'elementary', '2008-05-23 11:11:06', '2008-05-23 11:11:06', None, None, u"The 'elementary' design. Ideal as a basis for your own design.", u'<?xml version="1.0" encoding="UTF-8"?>\r\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "xhtml1-strict.dtd">\r\n<html xmlns="http://www.w3.org/1999/xhtml">\r\n<head>\r\n<title>PyLucid CMS - {% if PAGE.title %}{{ PAGE.title|escape }}{% else %}{{ PAGE.name|escape }}{% endif %}</title>\r\n<meta name="robots" content="{{ robots }}" />\r\n<meta name="keywords" content="{{ PAGE.keywords }}" />\r\n<meta name="description" content="{{ PAGE.description }}" />\r\n<meta name="Author" content="PyLucidCMS" />\r\n<meta name="DC.Date" content="{{ PAGE.lastupdatetime }}" />\r\n<meta name="DC.Date.created" content="{{ PAGE.datetime }}" />\r\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r\n<meta name="MSSmartTagsPreventParsing" content="TRUE" />\r\n<meta http-equiv="imagetoolbar" content="no" />\r\n<link rel="alternate" type="application/rss+xml" title="pages updates" href="{% lucidTag RSSfeedGenerator count="10" %}" />\r\n{% lucidTag page_style %}\r\n</head>\r\n<body>\r\n<div id="headline"><h2>PyLucid CMS</h2></div>\r\n\r\n{% lucidTag main_menu %}\r\n\r\n<div id="main_content">\r\n <h2 id="page_title">{% if PAGE.title %}{{ PAGE.title|escape }}{% else %}{{ PAGE.name|escape }}{% endif %}</h2>\r\n <!-- page_messages -->\r\n {% lucidTag admin_menu %}\r\n <p>{% lucidTag back_links %}</p>\r\n {{ PAGE.content }}\r\n <p id="permalink"><a href="{{ PAGE.get_permalink }}" title="permalink to this page">permalink</a></p>\r\n</div>\r\n\r\n<p id="footer">\r\n powered by {{ powered_by }} | {{ login_link }} | <!-- script_duration --> | last modified: {{ PAGE.lastupdatetime }}\r\n</p>\r\n\r\n</div>\r\n</body>\r\n</html>'] 10 [5, u'small_white', '2008-05-23 11:11:06', '2008-05-23 11:11:06', None, None, u"The 'small white' design.", u'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r\n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">\r\n<head>\r\n<title>PyLucid CMS - {% if PAGE.title %}{{ PAGE.title|escape }}{% else %}{{ PAGE.name|escape }}{% endif %}</title>\r\n<link rel="alternate" type="application/rss+xml" title="pages updates" href="{% lucidTag RSSfeedGenerator count="10" %}" />\r\n<link rel="shortcut icon" type="image/x-icon" href="/favicon_pylucid.ico">\r\n<meta http-equiv="content-type" content="text/html; charset=utf-8" />\r\n<meta name="robots" content="{{ robots }}" />\r\n<meta name="keywords" content="{{ PAGE.keywords }}" />\r\n<meta name="description" content="{{ PAGE.description }}" />\r\n<meta name="DC.Date" content="{{ PAGE.lastupdatetime }}" />\r\n<meta name="DC.Date.created" content="{{ PAGE.datetime }}" />\r\n<meta name="MSSmartTagsPreventParsing" content="TRUE" />\r\n<meta http-equiv="imagetoolbar" content="no" />\r\n{% lucidTag page_style %}\r\n</head>\r\n<body>\r\n<div id="wrap">\r\n <div id="header">\r\n <a href="/">\r\n <img id="pylucid_logo" src="/_static/pylucid_logo_2_364x76.jpg" alt="PyLucid CMS" title="PyLucid CMS" />\r\n </a>\r\n </div>\r\n\r\n <div id="leftside">\r\n <h2 class="hide">Menu:</h2>\r\n {% lucidTag main_menu %}\r\n {% lucidTag search %}\r\n </div>\r\n\r\n <div id="contentwide">\r\n <div id="admin">{% lucidTag admin_menu %}</div>\r\n <!-- page_messages -->\r\n <h2>{% if PAGE.title %}{{ PAGE.title|escape }}{% else %}{{ PAGE.name|escape }}{% endif %}</h2>\r\n <p>{% lucidTag back_links %}</p>\r\n {{ PAGE.content }}\r\n <p id="permalink"><a href="{{ PAGE.get_permalink }}" title="permalink to this page">permalink</a></p>\r\n </div>\r\n\r\n <div id="footer">\r\n <p>\r\n powered by {{ powered_by }} | {{ login_link }} | <!-- script_duration --> | last modified: {{ PAGE.lastupdatetime }}\r\n </p>\r\n </div>\r\n</div>\r\n</body>\r\n</html>\r\n'] 11 11 ] -
trunk/pylucid/PyLucid/index.py
r1583 r1585 98 98 context = RequestContext(request) 99 99 100 context["page_msg"]= PageMessages(context)100 request.page_msg = PageMessages(context) 101 101 102 102 # Redirect every "warning" messages into the page_msg: 103 redirect_warnings(context["page_msg"]) 103 # redirect_warnings(request.page_msg) 104 redirect_warnings(request.page_msg) 104 105 105 106 context["PAGE"] = current_page_obj … … 122 123 123 124 # Add the context to the reponse object. 124 # Used in PyLucid .middlewares.additional_content125 # Used in PyLucid middlewares 125 126 request.CONTEXT = context 127 128 # TODO: remove Backwards-incompatible changes in >v0.8.5 129 msg = ( 130 'Error, see: <a href="' 131 'http://www.pylucid.org/_goto/121/changes/#20-05-2008-page_msg' 132 '">pylucid.org - Backwards-incompatible changes - page_msg</a>' 133 ) 134 context["messages"] = [mark_safe(msg)] 126 135 127 136 return context -
trunk/pylucid/PyLucid/install/BaseInstall.py
r1505 r1585 130 130 131 131 self.page_msg = PageMessages(self.context) 132 self. context["page_msg"]= self.page_msg133 134 # Redirect every "warning" messages into context["page_msg"]:135 redirect_warnings(self. context["page_msg"])132 self.request.page_msg = self.page_msg 133 134 # Redirect every "warning" messages into request.page_msg: 135 redirect_warnings(self.request.page_msg) 136 136 137 137 #___________________________________________________________________________ … … 145 145 146 146 if msg and msg != "": # insert the messages: 147 self. context["page_msg"].write(msg)147 self.request.page_msg.write(msg) 148 148 149 149 return render_to_response( … … 172 172 # Cookie is not set or the salt hash value compair failed 173 173 if DEBUG: 174 self. context["page_msg"].write("DEBUG: %s" % msg)174 self.request.page_msg.write("DEBUG: %s" % msg) 175 175 else: 176 176 # access ok -> start the normal _install view() method … … 190 190 except WrongPassword, msg: 191 191 # Display the form again 192 self. context["page_msg"].write(msg)192 self.request.page_msg.write(msg) 193 193 else: 194 194 # Password is ok. -> process the normal _instal view() … … 205 205 206 206 self.context["no_menu_link"] = True # no "back to menu" link 207 # self. context["page_msg"].write(_("Please input the password"))207 # self.request.page_msg.write(_("Please input the password")) 208 208 return render_to_response("install_login.html", self.context) 209 209 -
trunk/pylucid/PyLucid/install/install.py
r1552 r1585 102 102 def view(self): 103 103 from PyLucid.tools.db_dump import loaddb 104 105 # Delete all prefecrences (only for alpha state!!!)106 from PyLucid.models import Preference107 Preference.objects.all().delete()108 104 109 105 self._redirect_execute( -
trunk/pylucid/PyLucid/install/update.py
r1584 r1585 19 19 20 20 #______________________________________________________________________________ 21 22 import re 23 from PyLucid.tools.Diff import diff_lines as _diff_lines 24 25 PAGE_MSG_RE = re.compile(r"""{% if messages %}.*?{% endif %}(?uims)""") 26 NEW_PAGE_MSG_TAG = "<!-- page_messages -->" 27 BACKUP_NAME_SUFFIX = " auto backup" 28 21 29 class Update2(BaseInstall): 22 30 def view(self): 23 31 self._redirect_execute(self._update_tables) 32 self._redirect_execute(self._update_templates) 24 33 25 34 return self._simple_render( 26 headline="Update PyLucid from v0.8.0 to v0.8. 1"35 headline="Update PyLucid from v0.8.0 to v0.8.5" 27 36 ) 28 37 29 38 def _update_tables(self): 30 print " update database tables:"39 print "*** update database tables:" 31 40 for table_name in ("pagesinternal", "markup"): 32 41 try: … … 40 49 print "OK" 41 50 51 def _update_templates(self): 52 print "\n*** update templates:" 53 templates = Template.objects.all() 54 for template in templates: 55 old_id = template.id 56 57 print "_"*79 58 print "process template '%s':" % template.name 59 60 if BACKUP_NAME_SUFFIX in template.name: 61 #template.delete() 62 print "Skip!" 63 continue 64 65 old_content = template.content 66 new_content = PAGE_MSG_RE.sub(NEW_PAGE_MSG_TAG, old_content) 67 if old_content == new_content: 68 print "Old tag not found or changes applied in the past." 69 continue 70 71 print "result diff:" 72 diff = _diff_lines(old_content, new_content) 73 print diff 74 print "-"*79 75 76 original_name = template.name 77 backup_name = original_name + BACKUP_NAME_SUFFIX 78 print "Create backup template '%s'..." % backup_name, 79 80 try: 81 bak_template = Template.objects.get(name=backup_name) 82 except Template.DoesNotExist: 83 # ok, create backup 84 template.name = backup_name 85 template.id = None 86 template.save() 87 print "OK" 88 else: 89 print "\nError: A template with the name '%s' exists." % ( 90 backup_name 91 ) 92 print "Skip update!" 93 continue 94 95 template.name = original_name 96 template.id = old_id 97 98 print "save new content...", 99 template.content = new_content 100 template.save() 101 print "OK" 42 102 43 103 def update2(request): 44 104 """ 45 1. update from v0.8.0 to v0.8. 1105 1. update from v0.8.0 to v0.8.5 46 106 """ 47 107 return Update2(request).start_view() … … 428 488 "<lucid(Function):(.*?)>(.*?)</lucidFunction>" 429 489 ) 430 PAGE_MSG_TAG = """\431 {% if messages %}432 <fieldset id="page_msg"><legend>page message</legend>433 {% for message in messages %}434 {{ message }}<br />435 {% endfor %}436 </fieldset>437 {% endif %}\438 """439 490 440 491 CHANGE_TAGS = { 441 "page_msg": PAGE_MSG_TAG,492 "page_msg": "<!-- page_messages -->", 442 493 "script_login": "{{ login_link }}", 443 494 "robots": "{{ robots }}", -
trunk/pylucid/PyLucid/middlewares/pagestats.py
r1546 r1585 25 25 26 26 from PyLucid.template_addons.filters import human_duration 27 from PyLucid.middlewares.utils import is_html, replace_content 27 28 28 29 # Save the start time of the current running pyhon instance … … 51 52 """ 52 53 # Put only the statistic into HTML pages 53 if not "html" in response._headers["content-type"][1]:54 if not is_html(response): 54 55 # No HTML Page -> do nothing 55 56 return response … … 69 70 } 70 71 71 content = response.content 72 if not isinstance(content, unicode): 73 # FIXME: In my shared webhosting environment is response.content a 74 # string and not unicode. Why? 75 from django.utils.encoding import force_unicode 76 try: 77 content = force_unicode(content) 78 except: 79 return response 72 # insert the page statistic 73 response = replace_content(response, TAG, stat_info) 80 74 81 # content = self.debug_sql_queries(content) 82 83 # insert the page statistic 84 new_content = content.replace(TAG, stat_info) 85 response.content = new_content 75 #response = self.debug_sql_queries(response) 86 76 87 77 return response 88 78 89 def debug_sql_queries(self, content): 79 def debug_sql_queries(self, response): 80 """ 81 Insert all SQL queries. 82 ONLY for developers! 83 """ 90 84 show_only = ("PyLucid_plugin", "PyLucid_preference2") 91 85 sql_info = "<h2>Debug SQL queries:</h2>" … … 106 100 sql_info += "\n%s\n%s\n" % (time, sql) 107 101 sql_info += "</pre></body>" 108 content = content.replace("</body>", sql_info) 109 return content 102 103 response = replace_content(response, "</body>", sql_info) 104 105 return response -
trunk/pylucid/PyLucid/models/Plugin.py
r1584 r1585 24 24 from django.contrib.auth.models import User, Group 25 25 26 from PyLucid.system.plugin_import import get_plugin_config, get_plugin_version 26 27 from PyLucid.tools.newforms_utils import get_init_dict, setup_help_text 27 28 from PyLucid.tools.data_eval import data_eval, DataEvalError … … 106 107 evaluate the pformat string into a dict and return it. 107 108 """ 108 data_dict = data_eval(self.pref_data_string) 109 if self.pref_data_string == None: 110 # There exist no preferences (e.g. plugin update not applied, yet) 111 data_dict = None 112 else: 113 data_dict = data_eval(self.pref_data_string) 109 114 preference_cache[self.plugin_name] = data_dict 110 115 return data_dict -
trunk/pylucid/PyLucid/plugins_internal/filemanager/filemanager.py
r1492 r1585 252 252 self.context = context 253 253 self.request = context["request"] 254 self.page_msg = context["page_msg"]254 self.page_msg = request.page_msg 255 255 256 256 def new_dir_path(self, path_info, must_exist=True): -
trunk/pylucid/PyLucid/settings_example.py
r1541 r1585 86 86 # Insert a statistic line into the generated page: 87 87 'PyLucid.middlewares.pagestats.PageStatsMiddleware', 88 89 'PyLucid.middlewares.pagemessages.PageMessagesMiddleware', 88 90 89 91 # PyLucidCommonMiddleware loads the django middlewares: -
trunk/pylucid/PyLucid/system/BasePlugin.py
r1565 r1585 52 52 self.internal_page = InternalPage(context, self.plugin_name) 53 53 54 self.request = context["request"] 55 self.response = response 54 56 self.context = context 55 self.response = response 56 57 self.request = context["request"] 58 self.page_msg = context["page_msg"] 57 58 self.page_msg = self.request.page_msg 59 59 self.URLs = context["URLs"] 60 60 61 61 self.current_page = self.context["PAGE"] 62 63 self.__preference_cache = None 64 65 def get_preferences(self): 66 """ 67 returns the preferences from the database as a dict 68 """ 69 if self.__preference_cache == None: 70 self.__preference_cache = Plugin.objects.get_preferences( 71 self.plugin_name 72 ) 73 return self.__preference_cache 62 74 63 75 def build_menu(self): -
trunk/pylucid/PyLucid/system/internal_page.py
r1486 r1585 37 37 """ 38 38 def __init__(self, context, plugin_name): 39 self.page_msg = context["page_msg"] 40 self.URLs = context["URLs"] 39 self.request = context["request"] 40 self.page_msg = self.request.page_msg 41 self.URLs = context["URLs"] 41 42 42 43 self.plugin_name = plugin_name -
trunk/pylucid/PyLucid/system/markups/tinyTextile.py
r1561 r1585 25 25 Last commit info: 26 26 ~~~~~~~~~~~~~~~~~ 27 $LastChangedDate $28 $Rev $29 $Author $27 $LastChangedDate:2008-05-13 18:26:55 +0200 (Di, 13 Mai 2008) $ 28 $Rev:1561 $ 29 $Author:JensDiemer $ 30 30 31 31 :copyleft: 2007-2008 by Jens Diemer … … 34 34 35 35 36 __version__ = "$Rev $"36 __version__ = "$Rev:1561 $" 37 37 38 38 import sys, re … … 46 46 self.out = out_obj 47 47 self.context = context 48 self.page_msg = context["page_msg"]48 self.page_msg = context["request"].page_msg 49 49 50 50 # Blockelements -
trunk/pylucid/PyLucid/system/page_msg.py
r1544 r1585 33 33 import os, sys, pprint, inspect 34 34 35 from django.utils.safestring import mark_safe 35 from django.utils.safestring import mark_safe, SafeData 36 from django.utils.encoding import force_unicode 37 36 38 from django.conf import settings 37 38 39 39 40 from PyLucid.tools.utils import escape … … 46 47 """ 47 48 def __init__(self, context): 49 request = context["request"] 50 48 51 try: 49 self.messages = context["messages"] 50 except KeyError: 51 # No django messages inserted by RequestContext 52 # In the _install section we use no RequestContext ;) 52 self.messages = request.user.get_and_delete_messages() 53 except AttributeError: 54 # In the _install section we have no user 53 55 self.messages = [] 54 56 55 request = context["request"]56 57 self.debug_mode = getattr(request, "debug", False) 57 58 … … 85 86 color, self.prepare(*msg) 86 87 ) 87 88 88 #~ self.request.user.message_set.create(message=msg) 89 89 msg = mark_safe(msg) # turn djngo auto-escaping off … … 93 93 """ 94 94 Append the fileinfo: Where from the announcement comes? 95 Only, if debug_mode is on.96 95 """ 97 if self.debug_mode != True:98 return ""99 100 96 try: 101 97 self_basename = os.path.basename(__file__) … … 126 122 -for dict, list use pprint ;) 127 123 """ 128 result = [self._get_fileinfo()] 124 if self.debug_mode == True: 125 result = [self._get_fileinfo()] 126 else: 127 result = [] 129 128 130 129 for item in msg: … … 141 140 142 141 result = "".join(result) 143 return escape(result)142 return result 144 143 145 144 def encode_and_prepare(self, txt): 146 145 """ 147 returns the given txt as a string object.146 Pass "safe" strings, all other would be escaped. 148 147 """ 149 if isinstance(txt, unicode):150 return txt .encode(self._charset)148 if isinstance(txt, SafeData): 149 return txt 151 150 152 # FIXME: Is that needed??? 153 try: 154 return str(txt) 155 except: 156 return repr(txt) 151 if not isinstance(txt, unicode): 152 txt = force_unicode(txt) 153 154 return escape(txt) 155 156 157 #________________________________________________________________ 158 159 def __repr__(self): 160 return "page messages: %s" % repr(self.messages) 161 162 def __str__(self): 163 return "pages messages: %s" % ", ".join(self.messages) 164 165 def __unicode__(self): 166 return u"page messages: %s" % u", ".join(self.messages) 157 167 158 168 #________________________________________________________________ -
trunk/pylucid/PyLucid/system/plugin_manager.py
r1565 r1585 53 53 plugin_name, method_name, msg 54 54 ) 55 context["page_msg"](msg)55 request.page_msg(msg) 56 56 msg2 = '<i title="(Error details in page messages.)">["%s.%s" error.]</i>' % ( 57 57 plugin_name, method_name … … 59 59 local_response.write(msg2) 60 60 61 # context["page_msg"](plugin_name, method_name)61 # request.page_msg(plugin_name, method_name) 62 62 try: 63 63 plugin = Plugin.objects.get(plugin_name=plugin_name) … … 73 73 debug = request.debug, 74 74 ) 75 # context["page_msg"](plugin_config.plugin_manager_data)75 # request.page_msg(plugin_config.plugin_manager_data) 76 76 try: 77 77 method_cfg = plugin_config.plugin_manager_data[method_name] … … 82 82 return 83 83 84 # context["page_msg"](method_cfg)84 # request.page_msg(method_cfg) 85 85 if method_cfg["must_login"]: 86 86 # User must be login to use this method … … 146 146 147 147 msg = "Run plugin %s.%s Error" % (plugin_name, method_name) 148 context["page_msg"].red("%s:" % msg)148 request.page_msg.red("%s:" % msg) 149 149 import sys, traceback 150 context["page_msg"]("<pre>%s</pre>" % traceback.format_exc())150 request.page_msg("<pre>%s</pre>" % traceback.format_exc()) 151 151 return msg + "(Look in the page_msg)" 152 152 -
trunk/pylucid/PyLucid/system/URLs.py
r1537 r1585 11 11 The view put a instance in context["URLs"]. The BasePlugin bind the class 12 12 to self. So every plugin can easy access the methods with self.URLs. 13 13 14 14 more info: http://pylucid.org/_goto/62/self-URLs/ 15 15 … … 102 102 self.context = context 103 103 self.request = context["request"] 104 self.page_msg = context["page_msg"]104 self.page_msg = self.request.page_msg 105 105 106 106 self.current_plugin = None -
trunk/pylucid/PyLucid/tools/content_processors.py
r1561 r1585 128 128 ./PyLucid/models.py 129 129 """ 130 page_msg = context["page_msg"] 130 request = context["request"] 131 page_msg = request.page_msg 131 132 132 133 if markup_no == 2: # textile -
trunk/pylucid/tests/utils/FakeRequest.py
r1493 r1585 28 28 META = {"HTTP_HOST": __fake_http_host,} 29 29 debug = True 30 page_msg = FakePageMsg() 30 31 def get_host(self): 31 32 """ … … 54 55 fake_context = { 55 56 "request": FakeRequest(), 56 "page_msg": FakePageMsg(),57 # "page_msg": , 57 58 "PAGE": page_object, 58 59 "CSS_ID_list": [],