Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Doc cleanups.

  • Loading branch information...
commit a5cb63976b680cfd936b9958519dc5cb6d769097 1 parent 34d6fc3
@SimonSapin authored
Showing with 19 additions and 7 deletions.
  1. +8 −0 docs/index.rst
  2. +11 −7 flask_flatpages/__init__.py
View
8 docs/index.rst
@@ -217,6 +217,14 @@ API
Changelog
---------
+Version 0.4
+~~~~~~~~~~~
+
+Not released yet.
+
+* Fix a bug with non-ASCII filenames.
+
+
Version 0.3
~~~~~~~~~~~
View
18 flask_flatpages/__init__.py
@@ -150,7 +150,10 @@ def _conditional_auto_reset(self):
def reload(self):
"""Forget all pages.
- All pages will be reloaded next time they're accessed"""
+
+ All pages will be reloaded next time they're accessed
+
+ """
try:
# This will "unshadow" the cached_property.
# The property will be re-executed on next access.
@@ -163,9 +166,8 @@ def __iter__(self):
return self._pages.itervalues()
def get(self, path, default=None):
- """
- :Return: the :class:`Page` object at ``path``, or ``default``
- if there is none.
+ """Returns the :class:`Page` object at ``path``, or ``default``
+ if there is no such page.
"""
# This may trigger the property. Do it outside of the try block.
@@ -176,9 +178,9 @@ def get(self, path, default=None):
return default
def get_or_404(self, path):
- """:Return: the :class:`Page` object at ``path``.
- :raises: :class:`NotFound` if the pages does not exist.
- This is caught by Flask and triggers a 404 error.
+ """Returns the :class:`Page` object at ``path``,
+ or raise :class:`NotFound` if there is no such page.
+ This is caught by Flask and triggers a 404 error.
"""
page = self.get(path)
@@ -192,6 +194,7 @@ def root(self):
It is the `FLATPAGES_ROOT` config value, interpreted as relative to
the app root directory.
+
"""
return os.path.join(self.app.root_path,
self.app.config['FLATPAGES_ROOT'])
@@ -200,6 +203,7 @@ def root(self):
def _pages(self):
"""Walk the page root directory an return a dict of
unicode path: page object.
+
"""
def _walk(directory, path_prefix=()):
for name in os.listdir(directory):
Please sign in to comment.
Something went wrong with that request. Please try again.