Refactor: BLI_path_util (part 2)

Use BKE_appdir/tempdir naming prefix for functions extracted from BLI_path_util
This commit is contained in:
2014-11-23 15:54:29 +01:00
parent 6308c16675
commit 43fa4baa6c
32 changed files with 135 additions and 133 deletions

View File

@@ -82,11 +82,11 @@ static PyObject *bpy_script_paths(PyObject *UNUSED(self))
PyObject *item;
const char *path;
path = BLI_get_folder(BLENDER_SYSTEM_SCRIPTS, NULL);
path = BKE_appdir_folder_id(BLENDER_SYSTEM_SCRIPTS, NULL);
item = PyC_UnicodeFromByte(path ? path : "");
BLI_assert(item != NULL);
PyTuple_SET_ITEM(ret, 0, item);
path = BLI_get_folder(BLENDER_USER_SCRIPTS, NULL);
path = BKE_appdir_folder_id(BLENDER_USER_SCRIPTS, NULL);
item = PyC_UnicodeFromByte(path ? path : "");
BLI_assert(item != NULL);
PyTuple_SET_ITEM(ret, 1, item);
@@ -168,11 +168,11 @@ static PyObject *bpy_user_resource(PyObject *UNUSED(self), PyObject *args, PyObj
return NULL;
}
/* same logic as BLI_get_folder_create(), but best leave it up to the script author to create */
path = BLI_get_folder(folder_id, subdir);
/* same logic as BKE_appdir_folder_id_create(), but best leave it up to the script author to create */
path = BKE_appdir_folder_id(folder_id, subdir);
if (!path)
path = BLI_get_user_folder_notest(folder_id, subdir);
path = BKE_appdir_folder_id_user_notest(folder_id, subdir);
return PyC_UnicodeFromByte(path ? path : "");
}
@@ -211,7 +211,7 @@ static PyObject *bpy_resource_path(PyObject *UNUSED(self), PyObject *args, PyObj
return NULL;
}
path = BLI_get_folder_version(folder_id, (major * 100) + minor, false);
path = BKE_appdir_folder_id_version(folder_id, (major * 100) + minor, false);
return PyC_UnicodeFromByte(path ? path : "");
}
@@ -296,7 +296,7 @@ void BPy_init_modules(void)
PyObject *mod;
/* Needs to be first since this dir is needed for future modules */
const char * const modpath = BLI_get_folder(BLENDER_SYSTEM_SCRIPTS, "modules");
const char * const modpath = BKE_appdir_folder_id(BLENDER_SYSTEM_SCRIPTS, "modules");
if (modpath) {
// printf("bpy: found module path '%s'.\n", modpath);
PyObject *sys_path = PySys_GetObject("path"); /* borrow */