Commit Graph

125 Commits

Author SHA1 Message Date
Neil Schemenauer efe8e3d235 Prepare 2.9 release.
There was a packaging error for 2.8.  It included files not intended
to be released which broke the 'ptl' package.  This release repairs
that error and includes a small change to random session tokens.
2015-12-08 11:25:25 -08:00
Neil Schemenauer 410c030b50 Use 128-bit random tokens for session keys and form tokens.
Our previous 64-bit values should still be more than secure
for web applications but recommended best practice is currently
128-bit.  We use URL-safe base64 encoding so the length of
the tokens is only a bit longer.
2015-12-08 11:16:30 -08:00
Neil Schemenauer 662c99f3e1 Use base64 instead of hex encoding for util.randbytes() 2015-12-08 11:16:05 -08:00
Neil Schemenauer c40fbfc433 Update version number to 2.8. 2014-01-17 15:27:42 -06:00
Neil Schemenauer 9448e19e53 Don't set duplicate ID attributes on radio inputs. 2013-08-25 08:42:32 -06:00
Patrik Simons b1e805d7c5 ptl_import recompiles ptl files
Since stat.st_mtime is a float in linux, _load_pyc will almost always
recompile the ptl files.  Here's a patch to make the logic follow
compile.c in python.
2013-08-25 08:33:02 -06:00
Neil Schemenauer 271678da41 Update version to 2.8b2. 2013-07-20 14:28:29 -06:00
Neil Schemenauer 36a187fa89 Set lineno attribute on generated Stmt node.
This fixes some problems with incorrect line numbers in
tracebacks.
2013-07-20 14:25:43 -06:00
Neil Schemenauer f09079828a Implement support for "Transfer-Encoding: chunked".
Use chunked transfer encoding if there is no content length
available and it's supported by the protocol (i.e. HTTP 1.1).
Stream responses without a length can now be compressed.
2013-07-20 14:22:32 -06:00
Neil Schemenauer bb8bdb686f Make StaticFile handle errors from os.stat(). 2012-11-23 10:35:37 -06:00
Neil Schemenauer 4b839a5b2d Support current twisted library. 2012-11-23 10:34:28 -06:00
Neil Schemenauer 08d1f048a8 Add quixote.get_param(). 2012-11-23 10:33:53 -06:00
Neil Schemenauer f1765e0dd4 Safer behavior for Directory meta-class.
Only mess with the _q_exports attribute if the export()
and subdir() decorators have been used.  This will hopefull
avoid any backwards compatibility surprises.
2012-11-17 13:46:25 -06:00
Neil Schemenauer 0b368c97a8 Update version to 2.8b1. 2012-01-02 13:58:30 -06:00
Neil Schemenauer 5a2856c6d5 Remove generated HTML docs from the version control system. 2012-01-02 13:49:37 -06:00
Neil Schemenauer b799be7d7f Update documentation for 2.8 changes.
Mention the export() decorator.  Simplify the explaination of
the mini demo.  Suggest starting the server using python -m
<module> since that avoids platform dependant paths.  Explain
how to make simple_server listen on a public interface.  Include
the latest docutils stylesheet.
2012-01-02 13:38:24 -06:00
Neil Schemenauer 97cb372be8 Use the export() and subdir() decorators for the demo. 2012-01-02 13:30:23 -06:00
Neil Schemenauer 7ed9542edd Improve the formatting of Quixote generated pages.
Introduce the errors.format_page() function and use it to generate
all HTML pages produced by Quixote.  It provides a single location
to "monkey-patch" if applications want to customize the look of the
pages.  Improve the wording of the messages on some of the error
pages.  Provide some basic CSS rules to make the pages look a little
more modern.  Use the HTML 5 doctype.
2012-01-02 13:24:00 -06:00
Neil Schemenauer 1940923eef Enable stricter HTTP request method checking.
By default, only allow GET, HEAD, and POST.  Allowed methods
can be set by the ALLOWED_METHODS config.  All methods can
be allowed by setting ALLOWED_METHODS to None.
2012-01-02 13:19:06 -06:00
Neil Schemenauer b5db7adfaf Add export() and subdir() decorators for managing _q_exports. 2012-01-02 13:04:20 -06:00
Neil Schemenauer ecd465a67d Have simple_server.py use Quixote access logger. 2012-01-01 22:22:28 -06:00
Neil Schemenauer 694ec7013a Increase resolution of elapsed time in access log.
To save space, prepend 's', instead of 'sec'.
2012-01-01 22:21:10 -06:00
Neil Schemenauer 9e95d765ac Add js_escape() utility. 2012-01-01 22:20:36 -06:00
Neil Schemenauer c5c9f46a5a Use Form.is_submitted() to check if Widget should parse.
Pass a reference to the form object to widgets.  Use
Form.is_submitted() to check if form has been submitted.  This
allows query strings to be provided to forms with a POST method
while preventing them from erroneously parsing themselves.
Previously the query string would cause them to think the form
was submitted.
2012-01-01 22:20:32 -06:00
Neil Schemenauer 223c4165dc Set 'id' attribute on form input elements.
This is useful when using Javascript to manipulate the form.  It
also now seems to be standard practice.
2012-01-01 22:20:26 -06:00
Neil Schemenauer 4de2a75fb7 Don't auto-set 'Expires' header if it already exists. 2012-01-01 22:20:15 -06:00
Neil Schemenauer f05f929a58 Add the format() method to htmltext. 2011-05-01 15:43:05 -06:00
Neil Schemenauer ce540d417e Change HTTPRequest to always consume request body.
Some clients and middleware expect that the body is always consumed.
Previous to this change, raising a PublishError exception (for
example) could result in a response being sent without the body
being consumed.  Requiring the application code to ensure that the
body is always consumed seems burdensome.  Using a temporary file
or StringIO object seems simplest and should not significantly
affect performance.
2011-05-01 13:28:06 -06:00
Neil Schemenauer 17de7e8c1b Update version to 2.7 2011-03-16 20:25:56 -06:00
Neil Schemenauer 954419bf43 Relax MIME boundary pattern (some clients skip final \r\n). 2011-03-16 19:30:00 -06:00
Neil Schemenauer a912ed0696 Update version to 2.7b2 2010-01-22 13:35:21 -06:00
Neil Schemenauer 21f96a219e Use the StringIO module rather than cStringIO.
cStringIO is gone in Python 3 and also does not handle unicode
strings properly.
2010-01-22 13:32:44 -06:00
Neil Schemenauer 94e589d6fe By default, set Cache-Control in addition to the Expires header.
The Expires header is sufficient for HTTP 1.0 but for HTTP 1.1 we
must add a must-revalidate directive.  Clients and proxies are
allowed to ignore Expires in certain cases and use stale pages (RFC
2616 sections 13.1.5 and 14.9.4).
2010-01-22 13:29:46 -06:00
Neil Schemenauer 584d2288c3 Disable cimport module for Python >= 2.6.
The current version of the cimport module does not support relative
imports. Disable it for now.
2010-01-22 13:28:58 -06:00
Neil Schemenauer 0ac6bb1e6b Fix reference to compile_file function (fixes compile_dir function). 2009-12-13 14:18:45 -06:00
Neil Schemenauer 6933fddf9c Update version for 2.7b1 release. 2009-09-07 01:37:11 -06:00
Neil Schemenauer 489b88e488 Add session iterator. 2009-09-07 01:34:31 -06:00
Neil Schemenauer 9949692385 Don't use callable(). 2009-09-07 01:34:27 -06:00
Neil Schemenauer 157772dcdb Use __contains__ instead of has_key. 2009-09-07 01:34:27 -06:00
Neil Schemenauer 863577fc01 Use utf-8 as default encoding. 2009-09-07 01:34:26 -06:00
Neil Schemenauer 5c39582cf6 Use built-in set type. 2009-09-07 01:34:26 -06:00
Neil Schemenauer 0b0e6fa714 Work around broken ihooks module in Python 2.6.
Using the import hook is still the most convenient way of using PTL
modules.
2009-09-07 01:31:24 -06:00
Neil Schemenauer 364e2940c1 Remove spurious kwargs from WidgetDict.__init__. 2009-09-07 01:03:08 -06:00
Neil Schemenauer 368a67cc1c Add options to sendmail so it can be used without a Quixote config.
Also, remove broken encode() call since it can't handle Unicode properly
as implemented.
2009-09-07 01:01:20 -06:00
Neil Schemenauer 4246ff0bbc Add SESSION_COOKIE_SECURE and SESSION_COOKIE_HTTPONLY.
Based on a suggestion from Emmanuel Dreyfus <manu@netbsd.org>, add
the SESSION_COOKIE_SECURE and SESSION_COOKIE_HTTPONLY options.
Setting them to true will cause the corresponding flag to be set
on the session cookie.
2009-09-07 00:50:13 -06:00
Hamish Lawson 9f566324df Check for other possible values of HTTPS.
Currently HTTPRequest only checks whether the HTTPS environment
variable has a value of 'on', but other possible positive values are
'1' (as set by mod_wsgi) and 'yes'.
2009-02-02 10:04:04 -06:00
Neil Schemenauer bf8a59aea4 Avoid infinite redirect when PATH_INFO is empty. 2009-01-06 20:16:39 -06:00
Neil Schemenauer a310893394 Add quixote.ptl.compile_package function.
The ihooks module is broken in Python 2.6 and will be gone in Python 3.
Provide compile_package() as an alternative method of compiling PTL
templates.
2008-11-25 22:22:12 -06:00
Neil Schemenauer d84e99703c Prepare for v2.6 release.
Remove CHANGES.txt file and generate it as necessary.  Update
version numbers and remove setup.py version check.
2008-07-05 17:51:20 -06:00
Neil Schemenauer cdb397b57f Improve README.txt.
Add link to wiki.  Add instructions on how to run the mini demo.
2008-07-05 17:50:14 -06:00