How to use the mikado.core.config function in Mikado

To help you get started, we’ve selected a few Mikado examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mikadosoftware / workstation / bin / immutableworkstation.py View on Github external
def read_disk_config():
    """

    Volumes - this is tricky to bend .ini files to handle lists of tuples
    The encoded json approach was just too fragile.
    So a new section is being added 
    """
    try:

        confd = config.read_ini(CONFIGLOCATION)
        if confd["devstation_config_root"].startswith("~/"):
            confd["devstation_config_root"] = confd["devstation_config_root"].replace(
                "~", os.path.expanduser("~")
            )
        volumesd = config.read_ini(CONFIGLOCATION)["volumes"]
        #: we want to convert an ini section to a dict.
        confd["volumes"] = {}
        for k, i in volumesd.items():
            if "~/" in k:
                # convert ~/data to /home/user/data
                newkey = os.path.join(os.path.expanduser("~"), k.replace("~/", ""))
                # we should have volumes = {'/home/user/data': '/var/data'}
                confd["volumes"][newkey] = i
                hasconfigdir = True
    except Exception as e:
        log.error("Failed to read config - error is %s", e)
github mikadosoftware / workstation / bin / immutableworkstation.py View on Github external
def read_disk_config():
    """

    Volumes - this is tricky to bend .ini files to handle lists of tuples
    The encoded json approach was just too fragile.
    So a new section is being added 
    """
    try:

        confd = config.read_ini(CONFIGLOCATION)
        if confd["devstation_config_root"].startswith("~/"):
            confd["devstation_config_root"] = confd["devstation_config_root"].replace(
                "~", os.path.expanduser("~")
            )
        volumesd = config.read_ini(CONFIGLOCATION)["volumes"]
        #: we want to convert an ini section to a dict.
        confd["volumes"] = {}
        for k, i in volumesd.items():
            if "~/" in k:
                # convert ~/data to /home/user/data
                newkey = os.path.join(os.path.expanduser("~"), k.replace("~/", ""))
                # we should have volumes = {'/home/user/data': '/var/data'}
                confd["volumes"][newkey] = i
                hasconfigdir = True
    except Exception as e:
        log.error("Failed to read config - error is %s", e)
        if PDB:
            import pdb

            pdb.set_trace()
        confd = {}

Mikado

A Python3 annotation program to select the best gene model in each locus

LGPL-3.0
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis