diff --git a/flaskext/frozen/__init__.py b/flaskext/frozen/__init__.py index 619bf6c..020aad1 100644 --- a/flaskext/frozen/__init__.py +++ b/flaskext/frozen/__init__.py @@ -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 diff --git a/setup.cfg b/setup.cfg index 527ee50..836ca93 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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