diff --git a/CHANGES.rst b/CHANGES.rst index ffae49ad..3b2abc20 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -6,7 +6,7 @@ Changelog Minor changes: -- ... +- add ``__all__`` variable to each modules in ``icalendar`` package Breaking changes: diff --git a/src/icalendar/cal.py b/src/icalendar/cal.py index 3c250596..83553f2a 100644 --- a/src/icalendar/cal.py +++ b/src/icalendar/cal.py @@ -764,3 +764,7 @@ def example(cls, name) -> Calendar: # These are read only singleton, so one instance is enough for the module types_factory = TypesFactory() component_factory = ComponentFactory() + +__all__ = ["Alarm", "Calendar", "Component", "ComponentFactory", "Event", + "FreeBusy", "INLINE", "Journal", "Timezone", "TimezoneDaylight", + "TimezoneStandard", "Todo", "component_factory", "get_example"] diff --git a/src/icalendar/caselessdict.py b/src/icalendar/caselessdict.py index 097dcd99..03bec28e 100644 --- a/src/icalendar/caselessdict.py +++ b/src/icalendar/caselessdict.py @@ -106,3 +106,6 @@ def sorted_items(self): Items not specified in canonical_order will appear at the end. """ return canonsort_items(self, self.canonical_order) + + +__all__ = ["canonsort_keys", "canonsort_items", "CaselessDict"] diff --git a/src/icalendar/cli.py b/src/icalendar/cli.py index ac53963c..e9d0eb72 100755 --- a/src/icalendar/cli.py +++ b/src/icalendar/cli.py @@ -83,5 +83,8 @@ def main(): for event in calendar.walk('vevent'): argv.output.write(view(event) + '\n\n') + +__all__ = ["main", "view"] + if __name__ == '__main__': main() diff --git a/src/icalendar/parser.py b/src/icalendar/parser.py index 10d95ad6..47ca858b 100644 --- a/src/icalendar/parser.py +++ b/src/icalendar/parser.py @@ -384,3 +384,11 @@ def from_ical(cls, st): # XXX: what kind of hack is this? import depends to be at end from icalendar.prop import vText + + +__all__ = ["Contentline", "Contentlines", "FOLD", "NAME", "NEWLINE", + "Parameters", "QUNSAFE_CHAR", "QUOTABLE", "UNSAFE_CHAR", "dquote", + "escape_char", "escape_string", "foldline", "param_value", "q_join", + "q_split", "tzid_from_dt", "uFOLD", "unescape_char", + "unescape_list_or_string", "unescape_string", "validate_param_value", + "validate_token"] diff --git a/src/icalendar/parser_tools.py b/src/icalendar/parser_tools.py index 47ad8092..ee9d02ca 100644 --- a/src/icalendar/parser_tools.py +++ b/src/icalendar/parser_tools.py @@ -48,3 +48,7 @@ def data_encode(data: Union[ICAL_TYPE, dict, list], encoding=DEFAULT_ENCODING) - return list(map(data_encode, data)) else: return data + + +__all__ = ["DEFAULT_ENCODING", "SEQUENCE_TYPES", "ICAL_TYPE" "data_encode", "from_unicode", + "to_unicode"] diff --git a/src/icalendar/prop.py b/src/icalendar/prop.py index 0a4c1b0e..509179ec 100644 --- a/src/icalendar/prop.py +++ b/src/icalendar/prop.py @@ -1122,3 +1122,11 @@ def from_ical(self, name, value): type_class = self.for_property(name) decoded = type_class.from_ical(value) return decoded + + +__all__ = ["DURATION_REGEX", "TimeBase", "TypesFactory", "WEEKDAY_RULE", + "tzid_from_dt", "vBinary", "vBoolean", "vCalAddress", + "vCategory", "vDDDLists", "vDDDTypes", "vDate", "vDatetime", + "vDuration", "vFloat", "vFrequency", "vGeo", "vInline", "vInt", + "vMonth", "vPeriod", "vRecur", "vSkip", "vText", "vTime", + "vUTCOffset", "vUri", "vWeekday"] diff --git a/src/icalendar/tests/test_equality.py b/src/icalendar/tests/test_equality.py index 8dadb109..5cb1cac8 100644 --- a/src/icalendar/tests/test_equality.py +++ b/src/icalendar/tests/test_equality.py @@ -5,7 +5,7 @@ except ImportError: pytz = None from icalendar.prop import * -from datetime import datetime, date, timedelta +from datetime import datetime, date, time, timedelta import pytest def assert_equal(actual_value, expected_value): diff --git a/src/icalendar/timezone/provider.py b/src/icalendar/timezone/provider.py index 18697b9a..8330c395 100644 --- a/src/icalendar/timezone/provider.py +++ b/src/icalendar/timezone/provider.py @@ -43,3 +43,5 @@ def uses_pytz(self) -> bool: @abstractmethod def uses_zoneinfo(self) -> bool: """Whether we use zoneinfo.""" + +__all__ = ["TZProvider"] diff --git a/src/icalendar/tools.py b/src/icalendar/tools.py index b9af20b7..896aa7a6 100644 --- a/src/icalendar/tools.py +++ b/src/icalendar/tools.py @@ -31,3 +31,5 @@ def uid(host_name='example.com', unique=''): unique = unique or UIDGenerator.rnd_string() today = to_unicode(vDatetime(datetime.today()).to_ical()) return vText(f'{today}-{unique}@{host_name}') + +__all__ = ["UIDGenerator"]