Skip to content

Commit

Permalink
More comments and docstrings.
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed May 28, 2011
1 parent bd30276 commit 7e913da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions flaskext/frozen/__init__.py
Expand Up @@ -82,16 +82,19 @@ def freeze(self):
# Don't build the same URL more than once
continue
seen_urls.add(url)
built_files.add(self._build_one(url))
new_filename = self._build_one(url)
built_files.add(new_filename)
# Remove files from the previous build that are not here anymore.
for extra_file in previous_files - built_files:
os.remove(extra_file)
parent = os.path.dirname(extra_file)
if not os.listdir(parent):
# now empty, remove
# The directory is now empty, remove it.
os.removedirs(parent)
return seen_urls

def _urls(self):
"""Run all generators and yield URLs relative to the app root."""
base_url = self.app.config['FREEZER_BASE_URL']
script_name = urlparse.urlsplit(base_url).path.rstrip('/')
# A request context is required to use url_for
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Expand Up @@ -3,6 +3,6 @@ source-dir = docs
build-dir = docs/_build
#all_files = 1

[upload_sphinx]
[upload_sphinx] # Sphinx-PyPI-upload
upload-dir = docs/_build/html

0 comments on commit 7e913da

Please sign in to comment.