Don't duplicate events in the generated year
This commit is contained in:
parent
8b135442af
commit
04b86bfe73
1 changed files with 4 additions and 0 deletions
|
|
@ -114,6 +114,10 @@ def cli(ctx):
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
def generate(ctx, year):
|
def generate(ctx, year):
|
||||||
calendar = ctx.obj
|
calendar = ctx.obj
|
||||||
|
calendar.subcomponents = [
|
||||||
|
component for component in calendar.subcomponents
|
||||||
|
if component.name != 'VEVENT'
|
||||||
|
or component['DTSTART'].dt.year != year]
|
||||||
make_calendar(calendar, year)
|
make_calendar(calendar, year)
|
||||||
with CALENDAR_FILE.open('wb') as f:
|
with CALENDAR_FILE.open('wb') as f:
|
||||||
f.write(calendar.to_ical())
|
f.write(calendar.to_ical())
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue