On 2018-03-06 09:37:31, Paul Wise wrote:
> Package: undertime
> Version: 1.2.0
> Severity: wishlist
>
> It would be nice to be able to specify different start/end times for
> the highlights for each timezone, since different meeting participants
> might have different requirements on times.
>
> One meeting participant might work during the day but be available in
> the early evening while another participant might be on night shift but
> be available during their breakfast period.
>
> I was thinking this might be a good way to do it but then I was
> thinking about having multiple availability periods for each timezone,
> but that might be conflating multiple feature requests into one :)
>
> $ undertime --no-default-zone -s 8 -e 9 Australia/Perth -s 9 -e 10 
> Europe/Paris -s 10 -e 11 America/Vancouver
> usage: undertime [-h] [--start HOUR] [--end HOUR] [--date WHEN] [--colors]
>                  [--default-zone] [--print-zones]
>                  [timezones [timezones ...]]
> undertime: error: unrecognized arguments: Europe/Paris America/Vancouver

Kind of weird that argparse can't deal with out of order arguments like
this... But yeah, if 'start' and 'end' would be nargs=+, we could
collect those and map them to the right timezone. You would need to
specify the start/end for all timezones otherwise things could break
down quickly: once parsed, argparse doesn't have a concept of which
option came before which argument. The above commandline would end up
something like:

start = [8, 9, 10]
end = [9, 10, 11]
zones = ['Australia/Perth', 'Europe/Paris', 'America/Vancouver']

So if you skip (say) Paris, you would end up with:

start = [8, 10]
end = [9, 11]
zones = ['Australia/Perth', 'Europe/Paris', 'America/Vancouver']

The user would expect 10-11 to be mapped to Vancouver, but it would
actually be mapped to Paris. Or Paris and Vancouver. I don't know how to
parse this. :) I would probably just error out if there are more than
one start/end times and that the count is different than the number of
timezones.

How does that sound?

A.

-- 
May your trails be crooked, winding, lonesome, dangerous, leading to
the most amazing view. May your mountains rise into and above the
clouds.
                        - Edward Abbey

Reply via email to