File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515CLI_APP = "when"
1616UI_APP_LABEL = "When Automation Tool"
1717UI_APP_COPYRIGHT = "© 2023-2025 Francesco Garosi"
18- UI_APP_VERSION = "1.12.1b6 "
18+ UI_APP_VERSION = "1.12.1b7 "
1919
2020# other strings that should not be translated
2121UI_WHENEVER = "Whenever"
Original file line number Diff line number Diff line change @@ -265,8 +265,19 @@ def load_checking(
265265 tab = CheckedTable (item , item_line )
266266 assert tab .get_str ("type" ) == self .type
267267 # TODO: check resulting dicts using get_array_of_dict_check_keys_vs_values
268- self .time_specifications = tab .get_list_of_dict (
269- "time_specifications" , mandatory = True
268+ tests = {
269+ "weekday" : lambda x : x in _WEEKDAYS_TOML ,
270+ "year" : lambda y : isinstance (y , int ) and 0 < y <= 9999 , # year boundaries
271+ "month" : lambda m : isinstance (m , int ) and 1 <= m <= 12 ,
272+ "day" : lambda d : isinstance (d , int ) and 1 <= d <= 31 ,
273+ "hour" : lambda h : isinstance (h , int ) and 0 <= h < 24 ,
274+ "minute" : lambda m : isinstance (m , int ) and 0 <= m < 60 ,
275+ "second" : lambda s : isinstance (s , int ) and 0 <= s < 60 ,
276+ }
277+ self .time_specifications = tab .get_list_of_dict_check_keys_vs_values (
278+ "time_specifications" ,
279+ lambda k , v : k in tests and tests [k ](v ),
280+ mandatory = True ,
270281 )
271282
272283 def as_table (self ):
Original file line number Diff line number Diff line change 11[tool .poetry ]
22name = " when"
3- version = " 1.12.1b6 "
3+ version = " 1.12.1b7 "
44description = " Interface for the **whenever** automation tool"
55authors = [" Francesco Garosi <francesco.garosi@gmail.com>" ]
66license = ' BSD 3-Clause "New" or "Revised" License'
You can’t perform that action at this time.
0 commit comments