Skip to content

Commit

Permalink
docs: add __all__ variables to some modules
Browse files Browse the repository at this point in the history
  • Loading branch information
c0d33ngr committed Jul 7, 2024
1 parent 6d0596d commit 43e5357
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 0 deletions.
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",
"types_factory"]
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"]
8 changes: 8 additions & 0 deletions src/icalendar/prop.py
Original file line number Diff line number Diff line change
Expand Up @@ -1119,3 +1119,11 @@ def from_ical(self, name, value):
type_class = self.for_property(name)
decoded = type_class.from_ical(value)
return decoded

__all__ = ["DSTDIFF", "DSTOFFSET", "DURATION_REGEX", "FixedOffset", "HOUR",
"LocalTimezone", "STDOFFSET", "TimeBase", "TypesFactory",
"WEEKDAY_RULE", "ZERO", "from_unicode", "tzid_from_dt", "vBinary",
"vBoolean", "vCalAddress", "vCategory", "vDDDLists", "vDDDTypes",
"vDate", "vDatetime", "vDuration", "vFloat", "vFrequency", "vGeo",
"vInline", "vInt", "vPeriod", "vRecur", "vText", "vTime",
"vUTCOffset", "vUri", "vWeekday"]
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"]

0 comments on commit 43e5357

Please sign in to comment.