pyonair/PyonAir-pycom

why?

Opened this issue · 0 comments

why?

import os

import strings as s
import ujson

# from ubinascii import hexlify
# from machine import unique_id
# from network import LoRa
from Constants import (
    CONFIG_FILE_DIRECTORY,
    CONFIG_FILE_FULL_NAME,
    CONFIG_FILE_NAME,
    DEBUG_CONFIG_FILE_DIRECTORY,
    DEBUG_CONFIG_FILE_FULL_NAME,
    DEBUG_CONFIG_FILE_NAME,
    DEFAULT_CONFIG,
)

# import imp

# TODO: memory hog, sort this class - static?


class ConfigurationException(Exception):
    """
    Exception to be thrown if Exception occurs in configuration
    """

    # TODO: why?
    pass


# Configuration
class Configuration:
    def __init__(self, logger):
        self.logger = logger
        self.configuration = {}
        # RM

        self.read_configuration()
        print("CONFIG READ########################################")

    # Configuration Accessor/Getter
    def get_config(self, keys=None):

        """

        If keys are given, return corresponding values in a list, if one key is given, return the corresponding value,
        if no arguments are given, return the config dictionary
        :param keys: keys in configuration dictionary

a0d19e78c9fc737579743c79f536a3b9fe0d1e7b