Adding documentation comments for doxygen (#1)
This commit is contained in:
@@ -1,11 +1,47 @@
|
||||
"""! @brief Defines the low-level DAO class to handle addresses."""
|
||||
##
|
||||
# @file AddressDAO.py
|
||||
#
|
||||
# @brief Defines the AddressDAO class.
|
||||
#
|
||||
# @section description_addressdao Description
|
||||
# Defines the low-lever DAO class to handle CRUD operations on addresses.
|
||||
# - AddressDAO (DAO class)
|
||||
#
|
||||
# @section libraries_addressdao Libraries/Modules
|
||||
# - <a href="https://pypi.org/project/mariadb/">mariadb</a> Python module
|
||||
# - MariaDB Connector/Python enables python programs to access MariaDB and MySQL databases, using an API which is compliant with the Python DB API 2.0 (PEP-249).
|
||||
# - <a href="https://docs.python.org/3/library/json.html">json</a> Python standard library
|
||||
# - JSON encoder and decoder.
|
||||
# - <a href="https://docs.python.org/3/library/random.html">DbManager</a> Local class
|
||||
# - Singleton class to provide for the database connection.
|
||||
#
|
||||
# @section notes_addressdao Notes
|
||||
# - None.
|
||||
#
|
||||
# @section todo_addressdao TODO
|
||||
# - None.
|
||||
#
|
||||
# @section author_addressdao Author(s)
|
||||
# - Created by Linuxero on 03/14/2025.
|
||||
# - Modified by Linuxero on 03/14/2025.
|
||||
#
|
||||
# Copyright (c) 2025 Schnaxero. All rights reserved.
|
||||
|
||||
from .DbManager import DbManager
|
||||
import mariadb
|
||||
import json
|
||||
|
||||
|
||||
class AddressDAO:
|
||||
"""! The AddressDAO class.
|
||||
Defines a low-level class utilized for DAO.
|
||||
Handles the address CRUD operations.
|
||||
"""
|
||||
__cur = None
|
||||
def __init__(self):
|
||||
"""! The AddressDAO class initializer.
|
||||
"""
|
||||
#print(f"*** File: {__file__}, init()")
|
||||
self.__con = DbManager().getConnection()
|
||||
|
||||
@@ -16,6 +52,8 @@ class AddressDAO:
|
||||
|
||||
|
||||
def __importPlz(self):
|
||||
"""! Utility function to import zipcodes from an external databases.
|
||||
"""
|
||||
with open("pfad zur datei", "r") as plz:
|
||||
postcodes = json.load(plz)
|
||||
irgendwas = ""
|
||||
@@ -37,6 +75,8 @@ class AddressDAO:
|
||||
print("FINISHED")#
|
||||
|
||||
def __importCountry(self):
|
||||
"""! Utility function to import countries information from an external databases.
|
||||
"""
|
||||
with open("pfad zur datei", "r") as country:
|
||||
countries = json.load(country)
|
||||
old = ""
|
||||
@@ -67,6 +107,11 @@ class AddressDAO:
|
||||
|
||||
|
||||
def getAddressData(self, all = True, zipcode = None):
|
||||
"""! Loads available addresses in the program.
|
||||
@param all Filter to get specific addresses as a boolean.
|
||||
@param zipcode Specific zipcode pattern.
|
||||
@return Found addresses as a dictionary on success, None on failure.
|
||||
"""
|
||||
try:
|
||||
if self.__cur:
|
||||
self.__cur.callproc("getAddress", (all, zipcode,))
|
||||
|
||||
Reference in New Issue
Block a user