[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[OpenTAL-checkins] opental/OpenPT OpenPTBase.py default_text/plone...
From: |
Fernando Lalo Martins |
Subject: |
[OpenTAL-checkins] opental/OpenPT OpenPTBase.py default_text/plone... |
Date: |
Mon, 03 Feb 2003 11:02:00 -0500 |
CVSROOT: /cvsroot/opental
Module name: opental
Changes by: Fernando Lalo Martins <address@hidden> 03/02/03 11:01:58
Modified files:
OpenPT : OpenPTBase.py
OpenPT/default_text: plone.pt sample.pt
OpenPT/www : fsptCustomize.pt ptAdd.pt ptEdit.pt
Log message:
changing 'here' to 'context'
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/opental/opental/OpenPT/OpenPTBase.py.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/opental/opental/OpenPT/default_text/plone.pt.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/opental/opental/OpenPT/default_text/sample.pt.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/opental/opental/OpenPT/www/fsptCustomize.pt.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/opental/opental/OpenPT/www/ptAdd.pt.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/opental/opental/OpenPT/www/ptEdit.pt.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
Patches:
Index: opental/OpenPT/OpenPTBase.py
diff -u opental/OpenPT/OpenPTBase.py:1.5 opental/OpenPT/OpenPTBase.py:1.6
--- opental/OpenPT/OpenPTBase.py:1.5 Thu Jan 30 11:32:28 2003
+++ opental/OpenPT/OpenPTBase.py Mon Feb 3 11:01:55 2003
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
-__version__='$Revision: 1.5 $'[11:-2]
+__version__='$Revision: 1.6 $'[11:-2]
# ugh, this import list needs to be cleaned up
import OpenTAL, pax, PTmetal_handler, pax.paxtransform
@@ -57,7 +57,7 @@
def call_with_ns(f, ns, arg=1):
td = Rtd()
- td.this = ns['here']
+ td.this = ns['context']
td._push(ns['request'])
td._push(InstanceDict(td.this, td))
td._push(ns)
@@ -269,7 +269,7 @@
func_defaults = None
func_code = FuncCode((), 0)
- _default_bindings = {'name_context': 'here',
+ _default_bindings = {'name_context': 'context',
'name_container': 'container',
'name_m_self': 'template',
'name_subpath': 'traverse_subpath',
@@ -497,12 +497,20 @@
security=getSecurityManager()
bound_names['user'] = security.getUser()
+ # backward compatibility; this is scheduled to be deprecated in a few
months
+ try:
+ bound_names['here'] = bound_names['context']
+ except KeyError:
+ # there isn't a 'context' binding yet
+ self.ZBindings_edit(self._default_bindings)
+ bound_names['context'] = bound_names['here']
+
# Retrieve the value from the cache.
keyset = {}
if self.ZCacheable_isCachingEnabled():
for n in ('traverse_subpath', 'options'):
keyset[n] = bound_names[n]
- keyset['here'] = bound_names['here'].absolute_url()
+ keyset['context'] = bound_names['context'].absolute_url()
result = self.ZCacheable_get(keywords=bound_names)
if result is not None:
# Got a cached value.
Index: opental/OpenPT/default_text/plone.pt
diff -u opental/OpenPT/default_text/plone.pt:1.1
opental/OpenPT/default_text/plone.pt:1.2
--- opental/OpenPT/default_text/plone.pt:1.1 Sun Jan 26 21:04:16 2003
+++ opental/OpenPT/default_text/plone.pt Mon Feb 3 11:01:57 2003
@@ -2,20 +2,20 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"
lang="en-US"
- metal:use-macro="here/main_template/macros/master"
+ metal:use-macro="context/main_template/macros/master"
i18n:domain="plone">
<metal:block fill-slot="base"
- tal:define="default_view
python:test(here.getId()=='index_html',1,0);">
+ tal:define="default_view
python:test(context.getId()=='index_html',1,0);">
<base href="#"
tal:condition="default_view"
- tal:attributes="href python:here.portal_url()+'/'+'/'.join(
here.portal_url.getRelativeContentPath(here))" />
+ tal:attributes="href python:context.portal_url()+'/'+'/'.join(
context.portal_url.getRelativeContentPath(context))" />
</metal:block>
<body>
<div metal:fill-slot="main">
- <h1 tal:content="here/title_or_id">
+ <h1 tal:content="context/title_or_id">
Title or id
</h1>
Index: opental/OpenPT/default_text/sample.pt
diff -u opental/OpenPT/default_text/sample.pt:1.1
opental/OpenPT/default_text/sample.pt:1.2
--- opental/OpenPT/default_text/sample.pt:1.1 Sun Jan 26 21:04:16 2003
+++ opental/OpenPT/default_text/sample.pt Mon Feb 3 11:01:57 2003
@@ -4,7 +4,7 @@
</head>
<body>
- <h2><span tal:replace="here/title_or_id">content title or id</span>
+ <h2><span tal:replace="context/title_or_id">content title or id</span>
<span tal:condition="template/title"
tal:replace="template/title">optional template id</span></h2>
Index: opental/OpenPT/www/fsptCustomize.pt
diff -u opental/OpenPT/www/fsptCustomize.pt:1.1
opental/OpenPT/www/fsptCustomize.pt:1.2
--- opental/OpenPT/www/fsptCustomize.pt:1.1 Thu Jan 30 11:32:28 2003
+++ opental/OpenPT/www/fsptCustomize.pt Mon Feb 3 11:01:58 2003
@@ -1,45 +1,45 @@
-<h1 tal:replace="structure here/manage_page_header">Header</h1>
+<h1 tal:replace="structure context/manage_page_header">Header</h1>
<h2 tal:define="manage_tabs_message options/manage_tabs_message | nothing"
- tal:replace="structure here/manage_tabs">Tabs</h2>
+ tal:replace="structure context/manage_tabs">Tabs</h2>
-<tal:block content="python:request.pt_output_encoding.force(here.encoding)" />
+<tal:block content="python:request.pt_output_encoding.force(context.encoding)"
/>
<tal:block define="global body request/other/text | request/form/text
-| here/read" />
+| context/read" />
<FORM ACTION="manage_doCustomize" METHOD="POST">
<TABLE CELLSPACING="2">
<TR>
<TH ALIGN="LEFT" VALIGN="TOP" class="form-label">Id</TH>
- <TD ALIGN="LEFT" VALIGN="TOP" class="form-element"
tal:content="here/getId"></TD>
+ <TD ALIGN="LEFT" VALIGN="TOP" class="form-element"
tal:content="context/getId"></TD>
</TR>
<tr>
<th align="left" valign="top" class="form-label">
<em>Size</em>
</th>
<td align="left" valign="top" class="form-element">
- <tal:block replace="python:'%.1f' % (here.get_size()/1024.0)" /> kbytes
+ <tal:block replace="python:'%.1f' % (context.get_size()/1024.0)" />
kbytes
</td>
</tr>
<tr>
<th align="left" valign="top" class="form-label">
<em>Last modified</em>
</th>
- <td align="left" valign="top" class="form-element"
tal:content="here/getModTime">
+ <td align="left" valign="top" class="form-element"
tal:content="context/getModTime">
</td>
</tr>
<tr>
<th align="left" valign="top" class="form-label">
<em>Encoding</em>
</th>
- <td align="left" valign="top" class="form-element"
tal:content="here/encoding">
+ <td align="left" valign="top" class="form-element"
tal:content="context/encoding">
</td>
</tr>
<tr>
<th align="left" valign="top" class="form-label">
<em>Source file</em>
</th>
- <td align="left" valign="top" class="form-element"
tal:content="here/getObjectFSPath">
+ <td align="left" valign="top" class="form-element"
tal:content="context/getObjectFSPath">
</td>
</tr>
<tr>
@@ -51,7 +51,7 @@
to make a copy of this template that can be customized.</em><br>
<select name="folder_path" size="1">
<option value="folder"
- tal:repeat="folder python:here.listCustFolderPaths('Page
Template')"
+ tal:repeat="folder python:context.listCustFolderPaths('Page
Template')"
tal:attributes="value python:folder[0]"
tal:content="python:folder[1]"
>Name</option>
@@ -62,7 +62,7 @@
</TABLE>
</FORM>
<table border="1" bgcolor="#cccccc"><tr><td>
-<pre tal:content="here/uread">body</pre>
+<pre tal:content="context/uread">body</pre>
</td></tr></table>
-<h1 tal:replace="structure here/manage_page_footer">Footer</h1>
+<h1 tal:replace="structure context/manage_page_footer">Footer</h1>
Index: opental/OpenPT/www/ptAdd.pt
diff -u opental/OpenPT/www/ptAdd.pt:1.2 opental/OpenPT/www/ptAdd.pt:1.3
--- opental/OpenPT/www/ptAdd.pt:1.2 Sun Jan 26 21:04:16 2003
+++ opental/OpenPT/www/ptAdd.pt Mon Feb 3 11:01:58 2003
@@ -1,7 +1,7 @@
-<h1 tal:replace="structure here/manage_page_header">Header</h1>
+<h1 tal:replace="structure context/manage_page_header">Header</h1>
<h2 tal:define="form_title string:Add Page Template"
- tal:replace="structure here/manage_form_title">Form Title</h2>
+ tal:replace="structure context/manage_form_title">Form Title</h2>
<p class="form-help">
Page Templates allow you to use simple HTML or XML attributes to
@@ -58,4 +58,4 @@
</table>
</form>
-<h1 tal:replace="structure here/manage_page_footer">Footer</h1>
+<h1 tal:replace="structure context/manage_page_footer">Footer</h1>
Index: opental/OpenPT/www/ptEdit.pt
diff -u opental/OpenPT/www/ptEdit.pt:1.3 opental/OpenPT/www/ptEdit.pt:1.4
--- opental/OpenPT/www/ptEdit.pt:1.3 Thu Jan 30 11:32:28 2003
+++ opental/OpenPT/www/ptEdit.pt Mon Feb 3 11:01:58 2003
@@ -1,12 +1,12 @@
-<h1 tal:replace="structure here/manage_page_header">Header</h1>
+<h1 tal:replace="structure context/manage_page_header">Header</h1>
<h2 tal:define="manage_tabs_message options/manage_tabs_message | nothing"
- tal:replace="structure here/manage_tabs">Tabs</h2>
+ tal:replace="structure context/manage_tabs">Tabs</h2>
-<tal:block content="python:request.pt_output_encoding.force(here.encoding)" />
+<tal:block content="python:request.pt_output_encoding.force(context.encoding)"
/>
<tal:block define="global body request/other/text | request/form/text
-| here/read" />
-<form action="" method="post" tal:attributes="action request/URL1;
accept-charset here/encoding">
+| context/read" />
+<form action="" method="post" tal:attributes="action request/URL1;
accept-charset context/encoding">
<input type="hidden" name=":default_method" value="pt_changePrefs">
<table width="100%" cellspacing="0" cellpadding="2" border="0">
<tr>
@@ -17,7 +17,7 @@
</td>
<td align="left" valign="middle">
<input type="text" name="title" size="40"
- tal:attributes="value request/title | here/title" />
+ tal:attributes="value request/title | context/title" />
</td>
<td align="right" valign="middle">
<div class="form-optional">
@@ -27,7 +27,7 @@
</td>
<td align="right" valign="middle">
<input type="text" name="encoding" size="14"
- tal:attributes="value request/encoding | here/encoding" />
+ tal:attributes="value request/encoding | context/encoding" />
</td>
</tr>
<tr>
@@ -38,7 +38,7 @@
</td>
<td align="left" valign="middle">
<input type="text" name="content_type" size="40"
- tal:attributes="value request/content_type | here/content_type" />
+ tal:attributes="value request/content_type | context/content_type"
/>
</td>
<td align="right" valign="middle">
<div class="form-label">
@@ -47,10 +47,10 @@
</td>
<td align="right" valign="middle">
<select name="source_type">
- <option tal:repeat="parser here/pt_parser_list"
+ <option tal:repeat="parser context/pt_parser_list"
tal:content="parser"
tal:attributes="selected
- python:test(parser==here.source_type,'selected',nothing)">XML</option>
+
python:test(parser==context.source_type,'selected',nothing)">XML</option>
</select>
</td>
</tr>
@@ -66,13 +66,13 @@
</td>
<td align="left" valign="middle" colspan="3">
<input type="text" name="acceptable_encodings:tokens" size="80"
style="width: 100%"
- tal:define="value request/acceptable_encodings |
here/acceptable_encodings"
+ tal:define="value request/acceptable_encodings |
context/acceptable_encodings"
tal:attributes="value python:' '.join(value)" />
</td>
</tr>
- <tr tal:define="errors here/pt_errors" tal:condition="errors">
- <tal:block define="global body python:here.document_src({'raw':1})"/>
+ <tr tal:define="errors context/pt_errors" tal:condition="errors">
+ <tal:block define="global body python:context.document_src({'raw':1})"/>
<td align="left" valign="middle" class="form-label">Errors</td>
<td align="left" valign="middle" style="background-color: #FFDDDD"
colspan="3">
@@ -80,7 +80,7 @@
</td>
</tr>
- <tr tal:define="warnings here/pt_warnings" tal:condition="warnings">
+ <tr tal:define="warnings context/pt_warnings" tal:condition="warnings">
<td align="left" valign="middle" class="form-label">Warnings</td>
<td align="left" valign="middle" style="background-color: #FFEEDD"
colspan="3">
@@ -107,11 +107,11 @@
</td>
<td align="left" valign="top" colspan="3">
<div class="form-element">
- <tal:block repeat="handler here/pt_handler_list">
+ <tal:block repeat="handler context/pt_handler_list">
<tal:block define="cb_id string:cb_handler_${repeat/handler/index}">
<input type="checkbox" name="handlers:list" tal:attributes="id cb_id;
value handler;
- checked python:test(handler in here.handlers, 'checked', nothing)">
+ checked python:test(handler in context.handlers, 'checked', nothing)">
<label tal:content="handler" tal:attributes="for cb_id">tal</label>
</tal:block>
</tal:block>
@@ -122,11 +122,11 @@
<tr>
<td align="left" valign="top" colspan="2">
<div class="form-element">
- <em tal:condition="here/wl_isLocked">Locked by WebDAV</em>
- <input tal:condition="not:here/wl_isLocked"
+ <em tal:condition="context/wl_isLocked">Locked by WebDAV</em>
+ <input tal:condition="not:context/wl_isLocked"
class="form-element" type="submit"
name="pt_editAction:method" value="Save Changes">
- <input tal:condition="not:here/wl_isLocked"
+ <input tal:condition="not:context/wl_isLocked"
class="form-element" type="submit"
name="pt_expand:method" value="Expand Macros">
@@ -145,11 +145,11 @@
</form>
<p class="form-text">Last modified:
-<tal:block
content="python:here.bobobase_modification_time().strftime('%Y-%m-%d %I:%M
%p')">1/1/2000
+<tal:block
content="python:context.bobobase_modification_time().strftime('%Y-%m-%d %I:%M
%p')">1/1/2000
</tal:block></p>
<p class="form-help">
-You can upload the text for <span tal:replace="here/title_and_id" />
+You can upload the text for <span tal:replace="context/title_and_id" />
using the following form.
Choose an existing file from your local computer by clicking
<em>browse</em>. You can also <a href="document_src">click here</a>
@@ -173,8 +173,8 @@
<td></td>
<td align="left" valign="top">
<div class="form-element">
- <em tal:condition="here/wl_isLocked">Locked by WebDAV</em>
- <input tal:condition="not:here/wl_isLocked"
+ <em tal:condition="context/wl_isLocked">Locked by WebDAV</em>
+ <input tal:condition="not:context/wl_isLocked"
class="form-element" type="submit" value="Upload File">
</div>
</td>
@@ -182,4 +182,4 @@
</table>
</form>
-<h1 tal:replace="structure here/manage_page_footer">Footer</h1>
+<h1 tal:replace="structure context/manage_page_footer">Footer</h1>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [OpenTAL-checkins] opental/OpenPT OpenPTBase.py default_text/plone...,
Fernando Lalo Martins <=