Only parse the files with the markup extension.

This commit is contained in:
Alexis Metaireau 2010-08-18 16:07:28 +02:00
commit 316d84ebb9
2 changed files with 3 additions and 2 deletions

2
TODO
View file

@ -1,4 +1,4 @@
* Fall back to settings + date of files when no metadata available * Fall back to settings + date of files when no metadata available
* Filter to generate only the files with .rst extension * Add RSS generation
* Add a licence * Add a licence
* package it ! * package it !

View file

@ -44,7 +44,8 @@ def generate_output(path=None, theme=None, output_path=None, markup=None,
# get the list of files to parse # get the list of files to parse
files = [] files = []
for root, dirs, temp_files in os.walk(path, followlinks=True): for root, dirs, temp_files in os.walk(path, followlinks=True):
files.extend([os.sep.join((root, f)) for f in temp_files]) files.extend([os.sep.join((root, f)) for f in temp_files
if f.endswith('.%s' % markup)])
articles, dates, years, tags, categories = [], {}, {}, {}, {} articles, dates, years, tags, categories = [], {}, {}, {}, {}
# for each file, get the informations. # for each file, get the informations.