Coverage for an_website/services/services.py: 100.000%

13 statements  

« prev     ^ index     » next       coverage.py v7.14.1, created at 2026-06-10 18:56 +0000

1# This program is free software: you can redistribute it and/or modify 

2# it under the terms of the GNU Affero General Public License as 

3# published by the Free Software Foundation, either version 3 of the 

4# License, or (at your option) any later version. 

5# 

6# This program is distributed in the hope that it will be useful, 

7# but WITHOUT ANY WARRANTY; without even the implied warranty of 

8# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 

9# GNU Affero General Public License for more details. 

10# 

11# You should have received a copy of the GNU Affero General Public License 

12# along with this program. If not, see <https://www.gnu.org/licenses/>. 

13 

14"""A page with a list of services that are cool and hosted by us.""" 

15 

16import dataclasses 

17 

18from ..utils.request_handler import HTMLRequestHandler 

19from ..utils.utils import ModuleInfo 

20 

21 

22def get_module_info() -> ModuleInfo: 

23 """Create and return the ModuleInfo for this module.""" 

24 return ModuleInfo( 

25 handlers=(("/services", ServicesHandler),), 

26 name="Service-Liste", 

27 description="Liste von coolen Services des Asozialen Netzwerks", 

28 path="/services", 

29 keywords=("Service", "Liste"), 

30 aliases=("/services-list",), 

31 ) 

32 

33 

34@dataclasses.dataclass(slots=True) 

35class Service: 

36 """A class representing a service.""" 

37 

38 title: str 

39 text: str 

40 infos: None | dict[str, str] 

41 

42 

43SERVICES: tuple[Service, ...] = ( 

44 # Service( 

45 # "Minceraft-Server", 

46 # ( 

47 # "Der Survival-Minceraft-Server des Asozialen Netzwerks funktioniert" 

48 # " auch ohne einen Minceraft-Account und hat dafür eine Integration" 

49 # " mit ely.by, damit auch Spieler, die ihren Minceraft-Account nicht" 

50 # " verraten möchten, einen eigenen Skin nutzen können." 

51 # ), 

52 # { 

53 # "Domain": "minceraft.asozial.org", 

54 # "Version": "1.15.2 (unterstützt 1.7-1.20)", 

55 # "Karte": "https://minceraft.asozial.org", 

56 # }, 

57 # ), 

58 # Service( 

59 # "SuperTuxKart-Server", 

60 # ( 

61 # "Der SuperTuxKart-Server des Asozialen Netzwerks ist durchgehend " 

62 # "online." 

63 # ), 

64 # { 

65 # "Name": "Das Asoziale Netzwerk", 

66 # "SuperTuxKart-Download": "https://supertuxkart.net/Download", 

67 # }, 

68 # ), 

69 # Service( 

70 # "Syncplay-Server", 

71 # ( 

72 # "Mit dem Syncplay-Server des Asozialen Netzwerks kann man Online " 

73 # "zusammen Sachen gucken." 

74 # ), 

75 # { 

76 # "Domain": "syncplay.asozial.org:8999", 

77 # "Installations-Guide": "https://syncplay.pl/guide/install", 

78 # }, 

79 # ), 

80 # Service( 

81 # "Matrix-Heimserver", 

82 # ( 

83 # "Der Matrix-Heimserver des Asozialen Netzwerks ist zuverlässig und" 

84 # " nutzt im Gegensatz zu den meisten anderen Servern Dendrite" 

85 # " anstatt Synapse. Die Erstellung eines Accounts ist 100% kostenlos" 

86 # " und ohne E-Mail-Adresse oder Telefonnummer möglich." 

87 # ), 

88 # { 

89 # "Domain": "asozial.org", 

90 # "Matrix-Client": "https://chat.asozial.org", 

91 # }, 

92 # ), 

93 Service( 

94 "XMPP-Server", 

95 "Das Asoziale Netzwerk hat einen XMPP-Server.", 

96 { 

97 "Domain": "asozial.org", 

98 "Software": "ejabberd", 

99 }, 

100 ), 

101) 

102 

103 

104class ServicesHandler(HTMLRequestHandler): 

105 """The request handler for this page.""" 

106 

107 async def get(self, *, head: bool = False) -> None: 

108 """Handle GET requests to the service list page.""" 

109 if head: 

110 return 

111 await self.render( 

112 "pages/services.html", 

113 services=SERVICES, 

114 )