From 7dcc06b34237549d6dd7550ac3650a9f257cb1bc Mon Sep 17 00:00:00 2001 From: Piper Thunstrom Date: Fri, 23 Aug 2019 21:06:20 -0400 Subject: [PATCH 1/2] Adds a page documenting ppb.flags. --- docs/reference/flags.rst | 29 +++++++++++++++++++++++++++++ docs/reference/index.rst | 1 + ppb/flags.py | 9 +++++---- 3 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 docs/reference/flags.rst diff --git a/docs/reference/flags.rst b/docs/reference/flags.rst new file mode 100644 index 00000000..a65fc342 --- /dev/null +++ b/docs/reference/flags.rst @@ -0,0 +1,29 @@ +============= +Flags +============= + +.. automodule:: ppb.flags + +-------------- +System flags +-------------- + +These are various flags defined for ppb engine use. + +.. autoclass:: ppb.flags.DoNotRender + +-------------- +Base classes +-------------- + +This is the base class for defining new flags. + +.. autoclass:: ppb.flags.Flag + +---------------- +Metaclasses +---------------- + +The metaclass that makes the type hinting of flags possible. + +.. autoclass:: ppb.flags.FlagMeta diff --git a/docs/reference/index.rst b/docs/reference/index.rst index 667fdb01..7942bec0 100644 --- a/docs/reference/index.rst +++ b/docs/reference/index.rst @@ -15,4 +15,5 @@ decisions are made, see the discussion section. assets scenes sprites + flags features/index diff --git a/ppb/flags.py b/ppb/flags.py index 65c97f3f..90a73cae 100644 --- a/ppb/flags.py +++ b/ppb/flags.py @@ -1,17 +1,18 @@ """ ppb.flags contains singletons to communicate various things. -Flags should be used like None and ... (Ellipsis): -* compare against using `is` +Flags should be used like ``None`` and ``...`` (Ellipsis): + +* compare against using ``is`` * Do not instantiate new instances -New flags can simply be defined by: +New flags can simply be defined by:: class MyFlag(Flag): "This is a flag to indicate a thing." -New classes of flags (eg mouse buttons) can be defined as: +New classes of flags (eg mouse buttons) can be defined as:: class MyFlagType(Flag, abstract=True): "A group of indicators" From 4918ea098c16e927dfc35ae34cc04d277b1a2408 Mon Sep 17 00:00:00 2001 From: Jamie Bliss Date: Mon, 20 May 2024 18:52:11 -0400 Subject: [PATCH 2/2] DoNotRender got nixed --- docs/reference/flags.rst | 8 -------- 1 file changed, 8 deletions(-) diff --git a/docs/reference/flags.rst b/docs/reference/flags.rst index a65fc342..d2bee822 100644 --- a/docs/reference/flags.rst +++ b/docs/reference/flags.rst @@ -4,14 +4,6 @@ Flags .. automodule:: ppb.flags --------------- -System flags --------------- - -These are various flags defined for ppb engine use. - -.. autoclass:: ppb.flags.DoNotRender - -------------- Base classes --------------