[Bf-blender-cvs] [6180b2911b] app-templates: Cleanup, also move SEP_STR into the header
Campbell Barton
noreply at git.blender.org
Thu Mar 23 19:15:35 CET 2017
Commit: 6180b2911bd9eb9cc3724c731df99a68e2667a3a
Author: Campbell Barton
Date: Fri Mar 24 05:13:36 2017 +1100
Branches: app-templates
https://developer.blender.org/rB6180b2911bd9eb9cc3724c731df99a68e2667a3a
Cleanup, also move SEP_STR into the header
===================================================================
M release/scripts/modules/bl_app_override/helpers.py
M release/scripts/modules/bpy/utils/__init__.py
M source/blender/blenkernel/intern/appdir.c
M source/blender/blenlib/BLI_path_util.h
===================================================================
diff --git a/release/scripts/modules/bl_app_override/helpers.py b/release/scripts/modules/bl_app_override/helpers.py
index ccce200c21..bf42c7809a 100644
--- a/release/scripts/modules/bl_app_override/helpers.py
+++ b/release/scripts/modules/bl_app_override/helpers.py
@@ -32,7 +32,7 @@ class AppOverrideState:
storing the result, then restoring later on.
Instead, the class can define callbacks (documented below),
- Then call call ``setup``, to reverse this call ``teardown``.
+ Then call ``setup``, and ``teardown`` to reverse.
All of the callbacks below are optional,
leaving them undeclared means you're opting out of manipulating
diff --git a/release/scripts/modules/bpy/utils/__init__.py b/release/scripts/modules/bpy/utils/__init__.py
index f760f52615..cefa505d8a 100644
--- a/release/scripts/modules/bpy/utils/__init__.py
+++ b/release/scripts/modules/bpy/utils/__init__.py
@@ -369,10 +369,7 @@ def app_template_paths(subdir=None):
:arg subdir: Optional subdir.
:type subdir: string
- :arg check_all: Include local, user and system paths rather just the paths
- blender uses.
- :type check_all: bool
- :return: script paths.
+ :return: app template paths.
:rtype: list
"""
import os
diff --git a/source/blender/blenkernel/intern/appdir.c b/source/blender/blenkernel/intern/appdir.c
index a86ef11254..5df32e5a82 100644
--- a/source/blender/blenkernel/intern/appdir.c
+++ b/source/blender/blenkernel/intern/appdir.c
@@ -655,23 +655,19 @@ bool BKE_appdir_program_python_search(
return is_found;
}
-#ifdef WIN32
-# define SEP_STR "\\"
-#else
-# define SEP_STR "/"
-#endif
-
static const char *app_template_directory_search[2] = {
"startup" SEP_STR "bl_app_templates_system",
"startup" SEP_STR "bl_app_templates_user",
};
-#undef SEP_STR
static const int app_template_directory_id[2] = {
BLENDER_SYSTEM_SCRIPTS,
BLENDER_USER_SCRIPTS,
};
+/**
+ * Return true if templates exist
+ */
bool BKE_appdir_app_template_any(void)
{
for (int i = 0; i < 2; i++) {
diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h
index 1c1725923a..a4f5c3c7a0 100644
--- a/source/blender/blenlib/BLI_path_util.h
+++ b/source/blender/blenlib/BLI_path_util.h
@@ -39,14 +39,6 @@ extern "C" {
struct ListBase;
-#ifdef WIN32
-#define SEP '\\'
-#define ALTSEP '/'
-#else
-#define SEP '/'
-#define ALTSEP '\\'
-#endif
-
void BLI_setenv(const char *env, const char *val) ATTR_NONNULL(1);
void BLI_setenv_if_new(const char *env, const char *val) ATTR_NONNULL(1);
@@ -145,6 +137,18 @@ bool BLI_path_suffix(char *string, size_t maxlen, const char *suffix, const char
# define FILE_MAX 1024
#endif
+#ifdef WIN32
+# define SEP '\\'
+# define ALTSEP '/'
+# define SEP_STR "\\"
+# define ALTSEP_STR "/"
+#else
+# define SEP '/'
+# define ALTSEP '\\'
+# define SEP_STR "/"
+# define ALTSEP_STR "\\"
+#endif
+
/* Parent and current dir helpers. */
#define FILENAME_PARENT ".."
#define FILENAME_CURRENT "."
More information about the Bf-blender-cvs
mailing list