How to use the appdirs.system function in appdirs

To help you get started, we’ve selected a few appdirs 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 rjdkmr / gcMapExplorer / gcMapExplorer / config.py View on Github external
import psutil


defaultConfigText="""
[Dirs]
WorkingDirectory = {0}

[Programs]
bigWigInfo = None
bigWigToWig = None

""".format(tempfile.gettempdir())

configAppDirs = AppDirs('gcMapExplorer')

if system == 'win32':
    configFileName = 'gcMapExplorer.ini'
else:
    configFileName = 'gcMapExplorer.conf'

configFile = os.path.join(configAppDirs.user_config_dir, configFileName)


def _defaultConfiguration():
    config = configparser.ConfigParser()
    config.read_string(defaultConfigText)
    return config

def updateConfig(section, option, value):
    """ Update configuration file

    Parameters
github jhtitor / citadel / bitsharesextra / storage.py View on Github external
def preflight(self, filename=True):
        d = user_data_dir(self.appname, self.appauthor)
        if "linux" in system:
            d = os.path.expanduser("~/.bitshares/")
        if not(os.path.isdir(d)): # Hack - create directory in advance
            os.makedirs(d, exist_ok=True)
        if not filename:
            return d
        return os.path.join(d, self.storageDatabaseDefault)

appdirs

A small Python module for determining appropriate platform-specific dirs, e.g. a "user data dir".

MIT
Latest version published 4 years ago

Package Health Score

77 / 100
Full package analysis

Similar packages