plugin talk: ordinamento stabile

This commit is contained in:
boyska 2018-06-29 15:19:32 +02:00
parent e3faa2cd49
commit c2f965c96d

View file

@ -64,10 +64,12 @@ def setlocale(name):
@memoize
def get_talk_names():
return [name for name in os.listdir(pelican.settings['TALKS_PATH'])
if not name.startswith('_') and
get_talk_data(name) is not None
]
names = [name for name in os.listdir(pelican.settings['TALKS_PATH'])
if not name.startswith('_') and
get_talk_data(name) is not None
]
names.sort()
return names
def all_talks():
@ -144,10 +146,9 @@ def get_talk_data(talkname):
del data['time']
if 'day' in data:
del data['day']
if 'day' in data:
else:
data['day'] = get_global_data()['startdate'] + \
datetime.timedelta(days=data['day'])
if 'time' in data and 'day' in data:
timeparts = re.findall(r'\d+', str(data['time']))
if 4 > len(timeparts) > 0:
timeparts = [int(p) for p in timeparts]
@ -358,7 +359,7 @@ class TalksGenerator(generators.Generator):
self._update_context(('talks',))
def generate_output(self, writer=None):
for talkname in self.talks:
for talkname in sorted(self.talks):
if 'resources' in self.talks[talkname]:
outdir = os.path.join(self.output_path,
pelican.settings['TALKS_PATH'], talkname,