Commit Graph

48 Commits

Author SHA1 Message Date
Takashi Kajinami 3f37303231 Modernize python versions
The versions listed in setup.cfg are quite old. Also fix the broken
unit tests and add the appropriate job template.

Depends-on: https://review.opendev.org/c/openstack/project-config/+/909494
Change-Id: Ifca330011b49af8a92bcf222760dd7fe0c873d30
2024-02-20 13:55:11 +09:00
rbowen 4c4ae58575 Report which week a meeting occurs.
Change-Id: I1afcb7e657dd898279aa80c325a3adbfa5f40248
2021-07-15 16:41:52 +00:00
Thierry Carrez b413607a97 Update hacking version
yaml2ical was using a very old version that started to break with
newer Python, so it's time to upgrade. This requires a few adjustments
to quiet new warnings.

Change-Id: Ib081dcfeca7c40f877059793dab58d00a7b0d53e
2021-07-15 14:49:54 +02:00
rbowen 90ddef2d8c Adds second- and fourth- week recurring meetings
Change-Id: I072e0018f24ced12b0b4557c8cc2db6b6a8d0ff5
2021-03-15 11:05:51 -04:00
Goutham Pacha Ravi da7f28db56 Add third week meetings schedule
The openstacksdks team meets on the
third thursday of each month. We could
use a a monthly third-week option.

Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
Change-Id: I9eee4582506274a18e7146f6c241cf56fb585075
2021-02-11 17:24:23 -08:00
Sean McGinnis a63d1c5e12
Add DTSTAMP and UID values to meeting instances
The iCalendar spec expects a meeting vEvent to include a datetime stamp
and a unique ID for each instance. This adds these values to the
generated output.

Minor cleanup also included since I was touching code around them and
noticed little nits.

Change-Id: I4753571850665a2f28a6799b84ead4c31a275cc7
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2019-06-27 10:30:08 -05:00
Doug Hellmann 02ba0f5a80 add day_specifier to recurrence
Add a new property to the recurrence that can be used to generate
grammatically correct versions of phrases like 'Monthly on the first
Thursday'.

Change-Id: I2ebfd60ebfbbc499ed08f6f63e91cbb87c8691b1
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-11-02 14:39:03 -04:00
Doug Hellmann cc4d324470 add base class for recurrence
Add an abstract base class for the recurrence rules so it is clear
which methods are required.

Change-Id: I7f2395bf3073b205a280d05f7f844f43a0e85ded
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-11-02 14:38:59 -04:00
Doug Hellmann 6a21064401 add monthly recurrence options
Add a recurrence option for meetings that repeat monthly. Instantiate
the ones for the first weekdays of the month for now.

Change-Id: I0fa95653594dc5a28008630f57bee67b92537d29
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-10-31 13:29:45 -04:00
Graham Hayes 0d1125f618
Fix output used by http://eavesdrop.openstack.org
Closes-Bug: #1771365

Change-Id: Ib2f695a0b36f704b85f9078b34c9811509906b6d
Signed-off-by: Graham Hayes <gr@ham.ie>
2018-05-15 15:23:39 +01:00
Graham Hayes 3150c1a59a
Allow for meeting to be scheduled every 4 weeks.
This allows for by weekly meetings to be run at alternate
times.

Change-Id: Ief437e53719c123399de8874469ef16540d3b3fd
Signed-off-by: Graham Hayes <gr@ham.ie>
2018-05-09 14:08:35 +01:00
Alex Schultz f2f98285ef Add Adhoc frequency
For the irc-meetings we would like to list the possiblity of a meeting
but not actually formally schedule it. This change allows for an AdHoc
meeting which is essentially a noop in the ical generation

Change-Id: I843b5b3f2a6e5a74b85b13b86c8d16125a1ac7c7
2017-08-01 10:37:01 -06:00
Jenkins cee12f20b1 Merge "Clarify KeyError() in Schedule.__init__()" 2016-11-25 02:47:42 +00:00
John L. Villalovos cf13e1a7ad Update hacking test-requirement
Update the hacking test-requirement to match openstack/requirements
global-requirements.txt

Fix errors caught by new version of hacking.

Change-Id: I90e9e9ed106b13b155b0b88fa2800736a9203814
2016-08-23 16:28:12 -07:00
Jenkins 691e5167b0 Merge "Fix off by 1 error in batch_messages & add unit tests" 2016-05-17 14:08:44 +00:00
John L. Villalovos 04317afb50 Remove intermediate datetime.datetime().date() usage
Instead of doing datetime.datetime().date(). Just call datetime.date()

Change-Id: I7f7b8a1e0a8a42d14e4431b5212901c4f57f1cf3
2016-04-18 09:20:52 -07:00
John L. Villalovos cd1f4760df Fix off by 1 error in batch_messages & add unit tests
Fix an off by one error in the batch_messages function. And add some
unit tests for the batch_messages function.

Also handle if batch_size is less than or equal to zero. In that case
just return the input messages.

Change-Id: Id7be110379c212104fba70588b647dfd3a13e765
Closes-Bug: #1570446
2016-04-15 10:36:50 -07:00
Jenkins b14b2fb3cf Merge "Add functionality to batch the meetings list" 2016-02-05 02:07:41 +00:00
Tony Breeds c08530843c Clarify KeyError() in Schedule.__init__()
If a YAML file contains an invalid recurrence the error is:
---
Invalid YAML meeting schedule definition - missing attribute 'weekly.'
< stack strace >
KeyError: 'weekly.'
---

This is quite right 'weekly.' isn't a missing attribute it's an invalid
recurrence type.  Refactor the code slightly to clarify the error message
---
Invalid meeting recurrence 'weekly.' - valid types: ['biweekly-odd', 'biweekly-even', 'weekly']
< stack strace >
KeyError: 'weekly.'
---

Change-Id: I8618bba454037744b82b5b96175d71ef8b2a652f
2016-02-04 10:34:41 +11:00
Tony Breeds 3dd31a4f91 Add functionality to batch the meetings list
Created and export, to jinja2, a batch_meetings fuction that will pivot
the sorted list of meetings into a number of colums.  This can be used
in a jinja template like:

  {% for column in batch_meetings(meetings, 4)|batch(4) %}

So the list:
     [A, B, C, D, E, F , G, H]

Dsisplays as:
    A C E G
    B D F H

Rather than:
    A B C D
    E F G H

Change-Id: I9d7c6ad9c14a9d6ec3d402a67b73fafae575d369
2016-02-03 11:52:57 +11:00
Tony Breeds f02d892ea6 Add one off events for skipped meetings
Rather than silently removing the skipped meeting from the calendar as
is the default behavious of exdate add a one off calendar entry for
each skipped meeting.

The aim is to show that the slot is generally consumed just that the
meeting has been explictly cancelled/skipped.

Change-Id: Idd9eb1a04fe9c9661e87978c0128a292bb8e89a4
2015-11-20 16:19:48 +11:00
Tony Breeds ddf64aef6e Add support for skipping/excluding meetings
In the OpenStack community it's common to cancel meetings while the
summit happens.

Add the ability to add a list of dates to skip.  These will then be
included in the iCal

Change-Id: I1dd5ca6f3e5d6d257489fdc14bbe108abc7436e6
2015-11-20 16:10:15 +11:00
Jenkins faabbec1a6 Merge "start_date now supported in schedules" 2015-06-30 17:17:01 +00:00
Brian (bex) Exelbierd a8c789d4b4 start_date now supported in schedules
start_date defines when a meeting series begins.  start_date
is used in lieu of the current date when rebuilding the calendar.

This will ultimately let us move away from needing to have
biweekly-odd and biweekly-even.

I also added an example.yaml with a start_date

Change-Id: I0c5f6e5951b6c15b949f599182f48aa132b76abb
2015-06-25 12:57:42 +02:00
Monty Taylor d561ce4247 Make help text less OpenStack specific
While yaml2ical is clearly driven by the needs of the OpenStack
community, there is nothing inherently "OpenStack" about the job it
does.

Also, the README doesn't need to describe what the tool wants to do,
since it has, in fact, accomplished its goal.

Change-Id: I7cf026858bc52eacd7650d9eb9d4b357deb5624f
2015-06-24 09:54:39 -04:00
Jenkins 616610813d Merge "Add 'outfile' var that can be used in templates" 2015-06-17 10:00:15 +00:00
Jenkins 746a15bcde Merge "Add project and agenda URLs to the bottom of calendar descriptions" 2015-06-17 10:00:05 +00:00
stephane 9d78fc35a6 Add meeting duration parameter
We currently hardcode the meeting duration to be one hour. This change
allows the user to specify an optional meeting duration (in minutes)
for shorter or longer meetings.

Change-Id: Ib41d56abc0e866ca50e45469e7cd57d726b053df
2015-06-16 19:34:44 +10:00
Tony Breeds afc3819c80 Fix issue with meetings that start on day1 and end on day2
Consider the following meetings (both at the same venue)
Meeting1:  Monday at 2330 for 1 hour
Meeting2: Tuesday at 0000 for 1 hour

It's clear that these meetings conflict.  The current conflicts() check
will return no conflict becuase we explictly check the start day.

Also there is a special case where day1 is Sunday so handle that case.

Fix this by converting the day into a date and including that in the conflicts
check.

Change-Id: I06f1f2ab644bf2f6aeb0e62258884a5ff85b6706
2015-06-16 19:32:41 +10:00
John L. Villalovos 423a997cc6 Add 'outfile' var that can be used in templates
Add an 'outfile' member variable to the meeting class.  This will store
the base name of the output filename that would be generated.

Change-Id: Id9354b3565c91fd1e143b3826da15ae38aa112aa
2015-06-12 14:49:55 -07:00
Brian (bex) Exelbierd f2ae365d3e Add project and agenda URLs to the bottom of calendar descriptions
agenda_url is already used in the meeting file template, now it will
be attached to every calendar event.

The new key project_url is for the page describing the overall
project and it too, if present will be in the calendar event.

Closes: https://storyboard.openstack.org/#!/story/2000288

Change-Id: Ic9f823bf744b27f42359858e55557b36fcab8f0a
Signed-off-by: Brian (bex) Exelbierd <bex@pobox.com>
2015-06-12 08:59:41 +02:00
Dave Walker (Daviey) 2d86450f7e Add Calendar Name and Description to output ical
Previously the calendar was missing a name and description
which means that some ical clients retain the URL rather
than having a human readable view.

This change introduces two new command line options
-n|--name and -d|--description for suppling the relevant
fields.

This implements the X-WR-CALNAME and X-WR-CALDESC ical
extension properties.

Change-Id: I97d44a2c924699ef362b7c053a637ace89b94fe2
Signed-off-by: Dave Walker (Daviey) <email@daviey.com>
2015-06-04 17:21:51 +01:00
Thierry Carrez ff513f9efe Add timestamp to the template variables
Add index generation timestamp as a variable available to template
authors ("timestamp").

Change-Id: I7607f0c7eebaad1adca2d6e92a356a3dab1f015b
2015-05-28 15:45:35 +02:00
Doug Hellmann 74cb5acd5f Allow extra settings for meetings to be used in templates
Besides looking for the required values, allow any extra values to be
saved and referenced from templates.

Change-Id: I7395a92f447aee943da54aa0439dd0c683da176a
2015-05-27 21:45:40 +00:00
Thierry Carrez 8bc6cf87c5 Add ability to generate a meeting index
Adding optional parameters -t and -w used to generate an index of
meetings using a Jinja2 template.

Refactor output file/dir preparation so that index generation can make
use of it.

Expose UTC time in the Schedule object and human-friendly description of
the recurrence in the Recurrence objects, so that they are directly
usable in the templates.

Change-Id: I103ac552f43a02a0b6e2e3ad6e5f52a6877efa68
2015-02-27 16:08:24 +01:00
Jenkins f14a9b4736 Merge "Refactor construction of meetings list." 2015-02-27 10:38:09 +00:00
stephane affdcfa153 Refactor construction of meetings list.
Handle undefined values gracefully in the Meeting and
Scheduler definitions. Refactor the Meeting class with improved
initialization and clean up the creation of the meetings
list.

Change-Id: Iad6a712c4b05c8af440c1f89966ae81102bb3e4e
2015-02-26 13:48:29 -08:00
Thierry Carrez 77c1530bde Start ical on current day
Start recurring events on the same day as the generation, since that day
is not really fully in the past yet.

Change-Id: I167fdd2d20b38b3c77029854fa3df191fb127181
2015-02-26 14:13:04 +01:00
Thierry Carrez 40f12c0d63 Fix conflict detection
Fix conflict detection by providing finer rules. Meetings on alternating
weeks no longer conflict. Meetings on overlapping times now conflict.

Add proper tests to check all combinations.

Change-Id: I069cdd40fecb5fd7a2ab828a495bdf627ca1a811
2015-02-25 12:16:50 +01:00
Thierry Carrez d6963905f1 Abstract recurrence styles as classes
Abstract recurrence styles as classes in recurrence.py, to make it
easier to add other recurrence styles.

Fix "biweekly" recurrences so that they use ISO week numbers (instead of
week number in the month, which prevents alternating meetings).

Change-Id: Ie786a545276c1aaf829daa93bc93245642f308a6
2015-02-23 15:41:46 +01:00
Thierry Carrez 3434d6294b Fix issue with biweekly meetings
Fix biweekly recurrence to correctly use next_weekday function.

Change-Id: I9cbfb6e34c597f04cae3ac4c90790b85b534908b
2015-02-19 12:39:43 +01:00
Thierry Carrez fefadc0d24 Fix issue in single file generation
Fix issue preventing single file generation.

Change-Id: I203169b522262efaa116101418b178d1a83cf9c8
2015-02-19 12:38:08 +01:00
Thierry Carrez 0d18942d98 Clarify conflict messages
In case of conflict, report the names of the two files at the origin of
the conflict (instead of $PROJECT-$HASH). Generate the ICS files under
the same name as the source YAML file, since those are unique anyway.

Change-Id: I7c9d5165c1327556ad19a592398f1312e4ac4ba3
2015-01-19 18:54:24 +01:00
Thierry Carrez 111fdaa366 Get rid of useless extract_meeting_info()
extract_meeting_info was mostly duplicating accessing the properties of
the Schedule object. Get rid of it and implement schedule comparison at
object level.

Change-Id: I1e6a6853b510f5733490107407ffe20139cf5966
2015-01-19 18:23:43 +01:00
Thierry Carrez 893c7cfa29 Refactor meetings.py
Make better use of Meetings objects by refactoring functions applying to
them as object methods.

Clean up superfluous argument value copy in cli.py as well.

Change-Id: Ib60597cec617ce296c4937c9bb3a086d4f61d48a
2015-01-19 17:38:23 +01:00
Thierry Carrez 4ab55d5c77 Reorganize modules in yaml2ical
Reorganize modules in yaml2ical so that:
- Reading meetings from YAML (and checking conflicts) is in meeting.py
- Functions to produce iCal output are in ical.py
- Date recurrence functions are in recurrence.py

There is no need for a generic utils.py anymore.
Further refactoring of functions and object classes is coming.

Change-Id: I35d2833f5eac088c13e684bf094a455591135dff
2015-01-16 18:24:24 +01:00
Thierry Carrez 923218b121 Use yaml2ical as CLI, clean up useless const.py
Declare a yaml2ical entry point to replace convert.py.

Clean up the useless const.py and move the only remaining constant to
meeting.py.

Change-Id: I6204aa2c9d96640e50167a9df78686a1cd25e9ec
2015-01-16 17:39:03 +01:00
Thierry Carrez 15d58bbb6d Rename 'arbiter' module to 'yaml2ical'
We'll need to upload this module to PyPI in order to properly integrate
with the OpenStack Infrastructure. Unfortunately, there is already a
module there going by the 'arbiter' name. This switches the module name
to 'yaml2ical', which is not sounding nice, but at least is functionally
correct.

The git repository itself shall be renamed once this is merged.

Change-Id: I896bcbe7be8c6a017015b428c6ff0d39a4974a04
2014-11-21 18:03:14 +01:00