We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 747a2d5 commit 10a039bCopy full SHA for 10a039b
doc/source/_static/img/howto_groups_app_tree.png
1.78 KB
tests/apps/util/management/commands/graph.py
@@ -15,18 +15,32 @@
15
else:
16
from typing import Annotated
17
18
-from enum import StrEnum
19
from pathlib import Path
20
21
import graphviz
22
import typer
23
24
25
-class Format(StrEnum):
26
- png = "png"
27
- svg = "svg"
28
- pdf = "pdf"
29
- dot = "dot"
+try:
+ from enum import StrEnum
+
+ class Format(StrEnum):
+ png = "png"
+ svg = "svg"
30
+ pdf = "pdf"
31
+ dot = "dot"
32
33
+except ImportError:
34
+ from enum import Enum
35
36
+ class Format(str, Enum):
37
38
39
40
41
42
+ def __str__(self):
43
+ return self.value
44
45
46
class Command(TyperCommand):
0 commit comments