Skip to content

genwiki2024 API Documentation

genwiki_cmd

Created on 2024-08-15

@author: wf

GenWikiCmd

Bases: WebserverCmd

command line handling for genealogy wiki frontend

Source code in genwiki/genwiki_cmd.py
15
16
17
18
19
20
21
22
23
24
25
class GenWikiCmd(WebserverCmd):
    """
    command line handling for genealogy wiki frontend
    """

    def __init__(self):
        """
        constructor
        """
        config = GenWikiWebServer.get_config()
        WebserverCmd.__init__(self, config, GenWikiWebServer, DEBUG)

__init__()

constructor

Source code in genwiki/genwiki_cmd.py
20
21
22
23
24
25
def __init__(self):
    """
    constructor
    """
    config = GenWikiWebServer.get_config()
    WebserverCmd.__init__(self, config, GenWikiWebServer, DEBUG)

main(argv=None)

main call

Source code in genwiki/genwiki_cmd.py
28
29
30
31
32
33
34
def main(argv: list = None):
    """
    main call
    """
    cmd = GenWikiCmd()
    exit_code = cmd.cmd_main(argv)
    return exit_code

version

Created on 2024-08-15

@author: wf

Version dataclass

Bases: object

Version handling for genwiki2024

Source code in genwiki/version.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
@dataclass
class Version(object):
    """
    Version handling for genwiki2024
    """

    name = "genwiki2024"
    version = genwiki.__version__
    date = "2024-08-15"
    updated = "2024-08-15"
    description = "genealogy Semantification"

    authors = "Wolfgang Fahl"

    doc_url = "https://wiki.bitplan.com/index.php/genwiki2024"
    chat_url = "https://github.com/WolfgangFahl/genwiki2024/discussions"
    cm_url = "https://github.com/WolfgangFahl/genwiki2024"

    license = f"""Copyright 2024 contributors. All rights reserved.

  Licensed under the Apache License 2.0
  http://www.apache.org/licenses/LICENSE-2.0

  Distributed on an "AS IS" basis without warranties
  or conditions of any kind, either express or implied."""
    longDescription = f"""{name} version {version}
{description}

  Created by {authors} on {date} last updated {updated}"""

webserver

Created on 2024-08-15

@author: wf

GenWikiSolution

Bases: InputWebSolution

the NiceSprinkler solution

Source code in genwiki/webserver.py
38
39
40
41
42
43
44
45
46
47
48
49
50
51
class GenWikiSolution(InputWebSolution):
    """
    the NiceSprinkler solution
    """

    def __init__(self, webserver: GenWikiWebServer, client: Client):
        """
        Initialize the solution

        Args:
            webserver (GenWikiWebServer): The webserver instance associated with this solution.
            client (Client): The client instance this context is associated with.
        """
        super().__init__(webserver, client)

__init__(webserver, client)

Initialize the solution

Parameters:

Name Type Description Default
webserver GenWikiWebServer

The webserver instance associated with this solution.

required
client Client

The client instance this context is associated with.

required
Source code in genwiki/webserver.py
43
44
45
46
47
48
49
50
51
def __init__(self, webserver: GenWikiWebServer, client: Client):
    """
    Initialize the solution

    Args:
        webserver (GenWikiWebServer): The webserver instance associated with this solution.
        client (Client): The client instance this context is associated with.
    """
    super().__init__(webserver, client)

GenWikiWebServer

Bases: InputWebserver

WebServer class that manages the server and handles Sprinkler operations.

Source code in genwiki/webserver.py
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
class GenWikiWebServer(InputWebserver):
    """WebServer class that manages the server and handles Sprinkler operations."""

    @classmethod
    def get_config(cls) -> WebserverConfig:
        copy_right = "(c)2024 Wolfgang Fahl"
        config = WebserverConfig(
            copy_right=copy_right,
            version=Version(),
            default_port=9852,
            short_name="genwiki2024",
        )
        server_config = WebserverConfig.get(config)
        server_config.solution_class = GenWikiSolution
        return server_config

    def __init__(self):
        """Constructs all the necessary attributes for the WebServer object."""
        InputWebserver.__init__(self, config=GenWikiWebServer.get_config())
        self.simulation = None

__init__()

Constructs all the necessary attributes for the WebServer object.

Source code in genwiki/webserver.py
32
33
34
35
def __init__(self):
    """Constructs all the necessary attributes for the WebServer object."""
    InputWebserver.__init__(self, config=GenWikiWebServer.get_config())
    self.simulation = None