diff --git a/README.md b/README.md index c3a9bbe..b088d1d 100644 --- a/README.md +++ b/README.md @@ -1409,10 +1409,10 @@ path = ArtifactoryPath( ## Global Configuration File ## -Artifactory Python module also can specify all connection-related settings in a central file, -```~/.artifactory_python.cfg``` that is read upon the creation of first ```ArtifactoryPath``` object and is stored -globally. For instance, you can specify per-instance settings of authentication tokens, so that you won't need to -explicitly pass ```auth``` parameter to ```ArtifactoryPath```. +Artifactory Python module also can specify all connection-related settings in a central file, given by environment +variable ```$DOHQ_ARTIFACTORY_PYTHON_CFG``` (default if not set: ```~/.artifactory_python.cfg```) that is read upon +the creation of first ```ArtifactoryPath``` object and is stored globally. For instance, you can specify per-instance +settings of authentication tokens, so that you won't need to explicitly pass ```auth``` parameter to ```ArtifactoryPath```. Example: diff --git a/artifactory.py b/artifactory.py index 754bcd0..766b58a 100755 --- a/artifactory.py +++ b/artifactory.py @@ -64,9 +64,12 @@ except ImportError: import ConfigParser as configparser -default_config_path = "~/.artifactory_python.cfg" -if platform.system() == "Windows": +if "DOHQ_ARTIFACTORY_PYTHON_CFG" in os.environ: + default_config_path = os.environ["DOHQ_ARTIFACTORY_PYTHON_CFG"] +elif platform.system() == "Windows": default_config_path = "~\\.artifactory_python.cfg" +else: + default_config_path = "~/.artifactory_python.cfg" global_config = None