예제 #1
0
 def create_config_filepath(cls, visibility=None):
     if cls.is_local(visibility):
         # Local to this directory
         base_path = os.path.join(".")
         if cls.IS_POLYAXON_DIR:
             # Add it to the current "./.polyaxon"
             base_path = os.path.join(base_path, ".polyaxon")
             cls._create_dir(base_path)
     elif cls.CONFIG_PATH:  # Custom path
         pass
     else:  # Handle both global and all cases
         base_path = polyaxon_user_path()
         cls._create_dir(base_path)
예제 #2
0
    def get_config_filepath(cls, create=True):
        if not cls.IS_GLOBAL:
            # local to this directory
            base_path = os.path.join(".")
            if cls.IS_POLYAXON_DIR:
                # Add it to the current "./.polyaxon"
                base_path = os.path.join(base_path, ".polyaxon")
                if create:
                    cls._create_dir(base_path)
        elif cls.CONFIG_PATH:  # Custom path
            base_path = cls.CONFIG_PATH
        else:
            base_path = polyaxon_user_path()
            if create:
                cls._create_dir(base_path)

        return os.path.join(base_path, cls.CONFIG_FILE_NAME)
예제 #3
0
 def get_global_config_path(cls) -> str:
     base_path = polyaxon_user_path()
     config_path = os.path.join(base_path, cls.CONFIG_FILE_NAME)
     return config_path