Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add __all__ variables to some modules #690

Merged
merged 10 commits into from
Jul 9, 2024
5 changes: 5 additions & 0 deletions src/icalendar/cal.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,3 +764,8 @@ 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", "dateutil",
c0d33ngr marked this conversation as resolved.
Show resolved Hide resolved
"types_factory"]
c0d33ngr marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 3 additions & 0 deletions src/icalendar/caselessdict.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
8 changes: 8 additions & 0 deletions src/icalendar/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
4 changes: 4 additions & 0 deletions src/icalendar/parser_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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", "data_encode", "from_unicode",
"to_unicode"]
1 change: 1 addition & 0 deletions src/icalendar/prop.py
Original file line number Diff line number Diff line change
Expand Up @@ -1122,3 +1122,4 @@ def from_ical(self, name, value):
type_class = self.for_property(name)
decoded = type_class.from_ical(value)
return decoded

2 changes: 2 additions & 0 deletions src/icalendar/timezone/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ def uses_pytz(self) -> bool:
@abstractmethod
def uses_zoneinfo(self) -> bool:
"""Whether we use zoneinfo."""

__all__ = ["TZProvider"]
2 changes: 2 additions & 0 deletions src/icalendar/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Loading